Index: openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl 27 Feb 2005 22:45:39 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/ad-functional-procs.tcl 10 Jan 2007 21:22:11 -0000 1.6 @@ -468,23 +468,23 @@ } ad_proc -public last {xs} "last element of a list" { - lindex $xs [expr [llength $xs]-1] + lindex $xs [expr {[llength $xs]-1}] } ad_proc -public init {xs} "all elements of a list but the last" { - lrange $xs 0 [expr [llength $xs]-2] + lrange $xs 0 [expr {[llength $xs]-2}] } ad_proc -public tail {xs} "all elements of a list but the first" { - lrange $xs 1 [expr [llength $xs]-1] + lrange $xs 1 [expr {[llength $xs]-1}] } ad_proc -public take {n xs} "returns the first n elements of xs" { lrange $xs 0 [expr {$n-1}] } ad_proc -public drop {n xs} "returns the remaining elements of xs (without the first n)" { - lrange $xs $n [expr [llength $xs]-1] + lrange $xs $n [expr {[llength $xs]-1}] } ad_proc -public filter {pred xs} { @@ -602,15 +602,15 @@ ad_proc -public transpose {lists} "tranposes a matrix (a list of lists)" { set num_lists [llength $lists] - if !$num_lists { return "" } + if {!$num_lists} { return "" } for {set i 0} {$i<$num_lists} {incr i} { set l($i) [lindex $lists $i] } set result {} while {1} { set element {} for {set i 0} {$i<$num_lists} {incr i} { - if [null_p $l($i)] { return $result } + if {[null_p $l($i)]} { return $result } lappend element [head $l($i)] set l($i) [tail $l($i)] }