Index: openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl,v
diff -u -r1.72.2.1 -r1.72.2.2
--- openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 15 Sep 2013 16:22:40 -0000 1.72.2.1
+++ openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 17 Sep 2013 17:49:23 -0000 1.72.2.2
@@ -201,7 +201,7 @@
if {[info command ::xotcl::nonposArgs] ne ""} {
::xotcl::nonposArgs proc integer args {
if {[llength $args] < 2} return
- foreach {name value} $args break
+ lassign $args name value
if {![string is integer $value]} {error "value '$value' of $name not an integer"}
}
::xotcl::nonposArgs proc optional {name args} {
@@ -277,7 +277,7 @@
}
Timestamp instproc report {{string ""}} {
- foreach {start_diff last_diff} [my diffs] break
+ lassign [my diffs] start_diff last_diff
my log "--$string (${start_diff}ms, diff ${last_diff}ms)"
}
Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v
diff -u -r1.97.2.1 -r1.97.2.2
--- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 25 Aug 2013 19:48:02 -0000 1.97.2.1
+++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 17 Sep 2013 17:49:23 -0000 1.97.2.2
@@ -274,7 +274,7 @@
error "package_key_and_version_older_than should be\
of the form 'package_key version'"
}
- foreach {package_key version} $p break
+ lassign $p package_key version
set installed_version [apm_highest_version_name $package_key]
if {[apm_version_names_compare $installed_version $version] > -1} {
# nothing to do
@@ -635,8 +635,8 @@
set slots ""
foreach att_info $attributes {
- foreach {attribute_name pretty_name pretty_plural datatype default_value
- min_n_values max_n_values} $att_info break
+ lassign $att_info attribute_name pretty_name pretty_plural datatype \
+ default_value min_n_values max_n_values
# ignore some erroneous definitions in the acs meta model
if {[my exists exclude_attribute($table_name,$attribute_name)]} continue
@@ -702,7 +702,7 @@
set last_function ""
set function_args {}
foreach definition $definitions {
- foreach {function arg_name default} $definition break
+ lassign $definition function arg_name default
if {$last_function ne "" && $last_function ne $function} {
set ::xo::db::sql::fnargs($last_function) $function_args
#puts stderr "$last_function [list $function_args]"
@@ -960,7 +960,7 @@
array set additional_defaults [[self class] set fallback_defaults(${package_name}__$object_name)]
set result [list]
foreach arg $function_args {
- foreach {arg_name default_value} $arg break
+ lassign $arg arg_name default_value
if {$default_value eq "" && [info exists additional_defaults($arg_name)]} {
lappend result [list $arg_name $additional_defaults($arg_name)]
} else {
@@ -976,7 +976,7 @@
my set arg_order [list]
my set function_args $function_args
foreach arg $function_args {
- foreach {arg_name default_value} $arg break
+ lassign $arg arg_name default_value
lappend psql_args \$_$arg_name
my lappend arg_order $arg_name
my set defined($arg_name) $default_value
@@ -1041,7 +1041,7 @@
::xo::db::Class proc create_all_functions {} {
foreach item [my get_all_package_functions] {
- foreach {package_name object_name} $item break
+ lassign $item package_name object_name
set class_name ::xo::db::sql::[string tolower $package_name]
if {![my isobject $class_name]} { ::xo::db::Class create $class_name }
$class_name dbproc_nonposargs [string tolower $object_name]
Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v
diff -u -r1.54 -r1.54.2.1
--- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 12 Aug 2013 20:01:06 -0000 1.54
+++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 17 Sep 2013 17:49:23 -0000 1.54.2.1
@@ -142,7 +142,7 @@
foreach attribute $args {
set l [split $attribute]
if {[llength $l] > 1} {
- foreach {attribute HTMLattribute} $l break
+ lassign $l attribute HTMLattribute
} else {
set HTMLattribute $attribute
}
@@ -166,7 +166,7 @@
foreach attribute $args {
set l [split $attribute]
if {[llength $l] > 1} {
- foreach {attribute HTMLattribute} $l break
+ lassign $l attribute HTMLattribute
} else {
set HTMLattribute $attribute
}
@@ -232,7 +232,7 @@
while {[regexp {^([^\x002]*)\x002\(\x001([^\x001]*)\x001\)\x002(.*)$} $text _ \
before key text]} {
append return_text $before
- foreach {package_key message_key} [split $key .] break
+ lassign [split $key .] package_key message_key
set url [export_vars -base $::xo::acs_lang_url/edit-localized-message {
{locale {[ad_conn locale]} }
package_key message_key
@@ -734,7 +734,7 @@
set actual_query ""
}
foreach pair [split $actual_query &] {
- foreach {key value} [split $pair =] break
+ lassign [split $pair =] key value
if {$key eq "orderby"} continue
lappend query [list [ns_urldecode $key] [ns_urldecode $value]]
}
Index: openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl,v
diff -u -r1.47 -r1.47.2.1
--- openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 21 Mar 2013 21:58:05 -0000 1.47
+++ openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 17 Sep 2013 17:49:23 -0000 1.47.2.1
@@ -50,7 +50,7 @@
fileSpooler proc deliver_ranges {ranges client_data filename fd channel} {
set first_range [lindex $ranges 0]
set remaining_ranges [lrange $ranges 1 end]
- foreach {from to size} $first_range break
+ lassign $first_range from to size
if {$remaining_ranges eq ""} {
# A single delivery, which is as well the last; when finished
# with this chunk, terminate delivery
@@ -113,7 +113,7 @@
# This method should not be necessary. However, under unclear conditions,
# some fcopies seem to go into a stasis. After 2000 seconds, we will kill it.
foreach {index entry} [array get ::running] {
- foreach {key elapsed} $entry break
+ lassign $entry key elapsed
set t [ns_time diff [ns_time get] $elapsed]
if {[ns_time seconds $t] > 2000} {
if {[regexp {^([^,]+),([^,]+),(.+)$} $index _ channel fd filename]} {
Index: openacs-4/packages/xotcl-core/tcl/chat-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/Attic/chat-procs.tcl,v
diff -u -r1.20 -r1.20.2.1
--- openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 29 Jul 2013 08:50:26 -0000 1.20
+++ openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 17 Sep 2013 17:49:23 -0000 1.20.2.1
@@ -104,7 +104,7 @@
if {[nsv_get $array-seen newest]>$last} {
#my log "--c must check $session_id: [nsv_get $array-seen newest] > $last"
foreach {key value} [nsv_array get $array] {
- foreach {timestamp secs user msg color} $value break
+ lassign $value timestamp secs user msg color
if {$timestamp > $last} {
my add [Message new -time $secs -user_id $user -msg $msg -color $color]
} else {
@@ -122,7 +122,7 @@
Chat instproc get_all {} {
my instvar array now session_id
foreach {key value} [nsv_array get $array] {
- foreach {timestamp secs user msg color} $value break
+ lassign $value timestamp secs user msg color
if {[my check_age $key [expr {($now - $timestamp) / 1000}]]} {
my add [Message new -time $secs -user_id $user -msg $msg -color $color]
}
Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v
diff -u -r1.63 -r1.63.2.1
--- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 12 Aug 2013 20:01:06 -0000 1.63
+++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 17 Sep 2013 17:49:23 -0000 1.63.2.1
@@ -535,7 +535,7 @@
set query [list [list $var $value]]
foreach pair [split $old_query &] {
- foreach {key value} [split $pair =] break
+ lassign [split $pair =] key value
if {$key eq $var} continue
lappend query [list [{*}$decodeCmd $key] [{*}$decodeCmd $value]]
}
@@ -554,7 +554,7 @@
set query [{*}$encodeCmd $var]=[{*}$encodeCmd $value]
foreach pair [split $old_query &] {
- foreach {key value} [split $pair =] break
+ lassign [split $pair =] key value
if {[{*}$decodeCmd $key] eq $var} continue
append query &$pair
}
Index: openacs-4/packages/xotcl-core/tcl/cr-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cr-procs.tcl,v
diff -u -r1.50 -r1.50.2.1
--- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 29 Jul 2013 08:39:07 -0000 1.50
+++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 17 Sep 2013 17:49:23 -0000 1.50.2.1
@@ -1583,7 +1583,7 @@
return [list $arrays $scalars]
}
CrCache::Item instproc set_non_persistent_vars {vars} {
- foreach {arrays scalars} $vars break
+ lassign $vars arrays scalars
foreach {var value} $arrays {my array set $var $value}
foreach {var value} $scalars {my set $var $value}
}
Index: openacs-4/packages/xotcl-core/tcl/policy-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/policy-procs.tcl,v
diff -u -r1.22 -r1.22.2.1
--- openacs-4/packages/xotcl-core/tcl/policy-procs.tcl 29 Jun 2013 22:42:56 -0000 1.22
+++ openacs-4/packages/xotcl-core/tcl/policy-procs.tcl 17 Sep 2013 17:49:24 -0000 1.22.2.1
@@ -80,7 +80,7 @@
set condition [lindex $p 0]
if {[llength $condition]>1} {
# we have a condition
- foreach {cond value} $condition break
+ lassign $condition cond value
if {[$object condition=$cond $query_context $value]} {
return [my get_privilege [list [lrange $p 1 end]] $object $method]
}
@@ -143,14 +143,14 @@
#my log "-- user_id=$user_id uid=[::xo::cc user_id] untrusted=[::xo::cc set untrusted_user_id]"
if {$permission ne ""} {
- foreach {kind p} [my get_privilege -query_context $ctx $permission $object $method] break
+ lassign [my get_privilege -query_context $ctx $permission $object $method] kind p
#my msg "--privilege = $p kind = $kind"
switch -- $kind {
primitive {return [my check_privilege -login false \
-package_id $package_id -user_id $user_id \
$p $object $method]}
complex {
- foreach {attribute privilege} $p break
+ lassign $p attribute privilege
set id [$object set $attribute]
#my msg "--p checking permission -object_id /$id/ -privilege $privilege -party_id $user_id\
# ==> [::xo::cc permission -object_id $id -privilege $privilege -party_id $user_id]"
@@ -177,7 +177,7 @@
set allowed 0
set permission [my get_permission $object $method]
if {$permission ne ""} {
- foreach {kind p} [my get_privilege $permission $object $method] break
+ lassign [my get_privilege $permission $object $method] kind p
switch -- $kind {
primitive {
set allowed [my check_privilege \
@@ -186,7 +186,7 @@
set privilege $p
}
complex {
- foreach {attribute privilege} $p break
+ lassign $p attribute privilege
set id [$object set $attribute]
set allowed [::xo::cc permission -object_id $id \
-privilege $privilege \
Index: openacs-4/packages/xotcl-core/www/show-object.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/www/show-object.tcl,v
diff -u -r1.15.6.2 -r1.15.6.3
--- openacs-4/packages/xotcl-core/www/show-object.tcl 17 Sep 2013 06:52:42 -0000 1.15.6.2
+++ openacs-4/packages/xotcl-core/www/show-object.tcl 17 Sep 2013 17:49:24 -0000 1.15.6.3
@@ -123,7 +123,7 @@
set pretty [list]
foreach p $parameters {
if {[llength $p]>1} {
- foreach {p default} $p break
+ lassign $p p default
lappend pretty "$p (default \"$default\")"
} else {
lappend pretty "$p"
Index: openacs-4/packages/xowiki/tcl/category-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/category-procs.tcl,v
diff -u -r1.26 -r1.26.2.1
--- openacs-4/packages/xowiki/tcl/category-procs.tcl 12 Aug 2013 19:46:49 -0000 1.26
+++ openacs-4/packages/xowiki/tcl/category-procs.tcl 17 Sep 2013 17:49:24 -0000 1.26.2.1
@@ -26,7 +26,7 @@
[category_tree::get_mapped_trees $object_id]}]
set trees [list]
foreach tree $mapped_trees {
- foreach {tree_id my_tree_name ...} $tree {break}
+ lassign $tree tree_id my_tree_name ...
# "names" is a list of category names
if {$names ne ""} {
@@ -49,7 +49,7 @@
}
# Get the values from info in "tree" into separate variables given by output.
# Note, that the order matters!
- foreach $output $tree break
+ lassign $tree {*}$output
set l [list]
foreach __var $output {lappend l [set $__var]}
lappend trees $l
Index: openacs-4/packages/xowiki/tcl/folder-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/folder-procs.tcl,v
diff -u -r1.27 -r1.27.2.1
--- openacs-4/packages/xowiki/tcl/folder-procs.tcl 29 Jul 2013 09:05:01 -0000 1.27
+++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 17 Sep 2013 17:49:24 -0000 1.27.2.1
@@ -575,7 +575,7 @@
}
}
- foreach {att order} [split $orderby ,] break
+ lassign [split $orderby ,] att order
$t orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att
set resources_list "[$t asHTML]"
Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v
diff -u -r1.239.2.1 -r1.239.2.2
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 14 Sep 2013 16:30:20 -0000 1.239.2.1
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Sep 2013 17:49:24 -0000 1.239.2.2
@@ -2191,15 +2191,15 @@
}
if {[my exists multiple] && [my set multiple]} {
foreach o [my set options] {
- foreach {label value} $o break
+ lassign $o label value
set labels($value) [my localize $label]
}
set values [list]
foreach i $v {lappend values $labels($i)}
return [join $values {, }]
} else {
foreach o [my set options] {
- foreach {label value} $o break
+ lassign $o label value
if {$value eq $v} {return [my localize $label]}
}
}
@@ -2233,7 +2233,7 @@
foreach category [::xowiki::Category get_category_infos \
-subtree_id $subtree_id -tree_id $tree_id] {
- foreach {category_id category_name deprecated_p level} $category break
+ lassign $category category_id category_name deprecated_p level
set category_name [ad_quotehtml [lang::util::localize $category_name]]
my set category_label($category_id) $category_name
if { $level>1 } {
@@ -2266,7 +2266,7 @@
radio instproc render_input {} {
set value [my value]
foreach o [my options] {
- foreach {label rep} $o break
+ lassign $o label rep
set atts [my get_attributes disabled {CSSclass class}]
if {[my exists forced_name]} {set name [my forced_name]} {set name [my name]}
lappend atts id [my id]:$rep name $name type radio value $rep
@@ -2308,7 +2308,7 @@
# maybe we can push this up to enumeration....
set value [my value]
foreach o [my options] {
- foreach {label rep} $o break
+ lassign $o label rep
set atts [my get_attributes disabled {CSSclass class}]
lappend atts id [my id]:$rep name [my name] type checkbox value $rep
if {$rep in $value} {lappend atts checked checked}
@@ -2344,7 +2344,7 @@
}
::html::select $atts {
foreach o $options {
- foreach {label rep} $o break
+ lassign $o label rep
set atts [my get_attributes disabled]
lappend atts value $rep
#my msg "lsearch {[my value]} $rep ==> [lsearch [my value] $rep]"
@@ -2384,7 +2384,7 @@
set js ""
foreach o [my options] {
- foreach {label rep} $o break
+ lassign $o label rep
set js_label [::xowiki::Includelet js_encode $label]
set js_rep [::xowiki::Includelet js_encode $rep]
append js "YAHOO.xo_sel_area.DDApp.values\['$js_label'\] = '$js_rep';\n"
@@ -2412,7 +2412,7 @@
::html::ul -id [my id]_candidates -class region {
#my msg [my options]
foreach o [my options] {
- foreach {label rep} $o break
+ lassign $o label rep
# Don't show current values under candidates
if {[info exists __values($rep)]} continue
::html::li -class candidates {::html::t $rep}
@@ -2471,7 +2471,7 @@
my set options [my get_labels $v]
if {[my multiple]} {
foreach o [my set options] {
- foreach {label value} $o break
+ lassign $o label value
set href [$package_id pretty_link -parent_id $parent_id $value]
set labels($value) "$label"
}
@@ -2491,7 +2491,7 @@
}
} else {
foreach o [my set options] {
- foreach {label value} $o break
+ lassign $o label value
#my log "comparing '$value' with '$v'"
if {$value eq $v} {
if {[my as_box]} {
@@ -3245,7 +3245,7 @@
if {$c ni [my components]} {my lappend components $c}
continue
}
- foreach {class code trim_zeros} [my set format_map($element)] break
+ lassign [my set format_map($element)] class code trim_zeros
#
# create for each component a form field
#
Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v
diff -u -r1.191 -r1.191.2.1
--- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 12 Aug 2013 19:46:49 -0000 1.191
+++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 17 Sep 2013 17:49:24 -0000 1.191.2.1
@@ -57,7 +57,7 @@
append result "{{[namespace tail $cl]"
foreach p [$cl info parameter] {
if {[llength $p] != 2} continue
- foreach {name value} $p break
+ lassign $p name value
if {$name eq "parameter_declaration"} {
foreach pp $value {
#append result ""
@@ -684,8 +684,8 @@
set open_item_id [expr {$open_page ne "" ?
[::xo::db::CrClass lookup -name $open_page -parent_id $folder_id] : 0}]
- foreach {locale locale_clause} \
- [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] break
+ lassign [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] \
+ locale locale_clause
set trees [::xowiki::Category get_mapped_trees -object_id $package_id -locale $locale \
-names $tree_name \
@@ -712,7 +712,7 @@
if {![my exists id]} {my set id [::xowiki::Includelet html_id [self]]}
foreach tree $trees {
- foreach {tree_id my_tree_name ...} $tree {break}
+ lassign $tree tree_id my_tree_name ...
set edit_html [my category_tree_edit_button -object_id $package_id \
-allow_edit $allow_edit -tree_id $tree_id]
@@ -731,7 +731,7 @@
set category_infos [::xowiki::Category get_category_infos \
-locale $locale -tree_id $tree_id]
foreach category_info $category_infos {
- foreach {cid category_label deprecated_p level} $category_info {break}
+ lassign $category_info cid category_label deprecated_p level
set c [::xowiki::TreeNode new -orderby pos \
-level $level -label $category_label -pos [incr pos]]
set cattree($level) $c
@@ -804,7 +804,7 @@
}
append content [$cattree(0) render -style [my set style]]
} else {
- foreach {orderby direction} [split $order_items_by ,] break ;# e.g. "title,asc"
+ lassign [split $order_items_by ,] orderby direction ;# e.g. "title,asc"
set increasing [expr {$direction ne "desc"}]
set order_column ", p.page_order"
@@ -876,8 +876,8 @@
if {![my exists id]} {my set id [::xowiki::Includelet html_id [self]]}
set cattree [::xowiki::Tree new -volatile -id [my id]]
- foreach {locale locale_clause} \
- [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] break
+ lassign [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] \
+ locale locale_clause
set tree_ids [::xowiki::Category get_mapped_trees -object_id $package_id -locale $locale \
-names $tree_name -output tree_id]
@@ -1434,7 +1434,7 @@
set return_url [$package_id query_parameter return_url]
}
foreach cat_id [category::get_mapped_categories [$__including_page set item_id]] {
- foreach {category_id category_name tree_id tree_name} [category::get_data $cat_id] break
+ lassign [category::get_data $cat_id] category_id category_name tree_id tree_name
#my log "--cat $cat_id $category_id $category_name $tree_id $tree_name"
set entry "$category_name ($tree_name)"
if {$notification_type ne ""} {
@@ -1730,7 +1730,7 @@
"select count(distinct user_id) from xowiki_last_visited WHERE $where_clause"]
}
foreach value $values {
- foreach {user_id time} $value break
+ lassign $value user_id time
set seen($user_id) $time
regexp {^([^.]+)[.]} $time _ time
@@ -1861,10 +1861,10 @@
set extra_where_clause ""
if {[my exists category_id]} {
- foreach {cnames extra_where_clause} [my category_clause [my set category_id]] break
+ lassign [my category_clause [my set category_id]] cnames extra_where_clause
}
- foreach {locale locale_clause} \
- [::xowiki::Includelet locale_clause -revisions p -items p $package_id $locale] break
+ lassign [::xowiki::Includelet locale_clause -revisions p -items p $package_id $locale] \
+ locale locale_clause
#my msg locale_clause=$locale_clause
if {$source ne ""} {
@@ -1895,7 +1895,7 @@
$pages mixin add ::xo::OrderedComposite::IndexCompare
if {$range ne "" && $page_order_att ne ""} {
- foreach {from to} [split $range -] break
+ lassign [split $range -] from to
foreach p [$pages children] {
if {[$pages __value_compare [$p set page_order] $from 0] == -1
|| [$pages __value_compare [$p set page_order] $to 0] > 0} {
@@ -2300,7 +2300,7 @@
$pages mixin add ::xo::OrderedComposite::IndexCompare
if {$range ne ""} {
- foreach {from to} [split $range -] break
+ lassign [split $range -] from to
foreach p [$pages children] {
if {[$pages __value_compare [$p set page_order] $from 0] == -1
|| [$pages __value_compare [$p set page_order] $to 0] > 0} {
@@ -2552,11 +2552,11 @@
set extra_where_clause ""
set cnames ""
if {[info exists category_id]} {
- foreach {cnames extra_where_clause} [my category_clause $category_id] break
+ lassign [my category_clause $category_id] cnames extra_where_clause
}
- foreach {locale locale_clause} \
- [::xowiki::Includelet locale_clause -revisions p -items p $package_id $locale] break
+ lassign [::xowiki::Includelet locale_clause -revisions p -items p $package_id $locale] \
+ locale locale_clause
if {$folder_mode} {
# TODO just needed for michael aram?
@@ -2580,7 +2580,7 @@
# filter range
#
if {$range ne ""} {
- foreach {from to} [split $range -] break
+ lassign [split $range -] from to
foreach p [$pages children] {
if {[$pages __value_compare [$p set page_order] $from 0] == -1
|| [$pages __value_compare [$p set page_order] $to 0] > 0} {
@@ -3106,8 +3106,8 @@
set edgesHTML ""; set c 0
foreach p [lsort -index 1 -decreasing -integer $edges] {
- foreach {edge weight width} $p break
- foreach {a b} [split $edge ,] break
+ lassign $p edge weight width
+ lassign [split $edge ,] a b
#my log "--G $a -> $b check $c > $max_edges, $weight < $cutoff"
if {[incr c]>$max_edges} break
if {$weight < $cutoff} continue
@@ -3508,9 +3508,9 @@
if {![info exists button_objs]} {
foreach b $buttons {
if {[llength $b]>1} {
- foreach {button id} $b break
+ lassign $b button id
} else {
- foreach {button id} [list $b $form_item_id] break
+ lassign [list $b $form_item_id] button id
}
set form [::xo::db::CrClass get_instance_from_db -item_id $id]
#
@@ -3603,7 +3603,7 @@
Field count -orderby count -label count
}
- foreach {att order} [split $orderby ,] break
+ lassign [split $orderby ,] att order
t1 orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att
foreach {value count} [array get __count] {
t1 add -value $value -count $count
@@ -3859,7 +3859,7 @@
# that page_order can be sorted with the special mixin and that
# instance attributes can be used for sorting as well.
#
- foreach {att order} [split $orderby ,] break
+ lassign [split $orderby ,] att order
if {$att eq "__page_order"} {
t1 mixin add ::xo::OrderedComposite::IndexCompare
}
@@ -3889,7 +3889,7 @@
#my log "exists category_id [info exists category_id]"
set extra_where_clause ""
if {[info exists category_id]} {
- foreach {cnames extra_where_clause} [my category_clause $category_id bt.item_id] break
+ lassign [my category_clause $category_id bt.item_id] cnames extra_where_clause
}
set items [::xowiki::FormPage get_form_entries \
Index: openacs-4/packages/xowiki/tcl/link-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v
diff -u -r1.90 -r1.90.2.1
--- openacs-4/packages/xowiki/tcl/link-procs.tcl 13 Sep 2012 16:05:28 -0000 1.90
+++ openacs-4/packages/xowiki/tcl/link-procs.tcl 17 Sep 2013 17:49:24 -0000 1.90.2.1
@@ -359,7 +359,7 @@
::xo::Page requireJS /resources/xowiki/swfobject.js
my instvar package_id name
#set link [$package_id pretty_link -absolute true -siteurl http://localhost:8003 $name]/download.swf
- foreach {width height bgcolor version} {320 240 #999999 7} break
+ lassign {320 240 #999999 7} width height bgcolor version
foreach a {width height bgcolor version} {if {[my exists $a]} {set $a [my set $a]}}
set id [::xowiki::Includelet self_id]
set addParams ""
Index: openacs-4/packages/xowiki/tcl/notification-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/notification-procs.tcl,v
diff -u -r1.19 -r1.19.2.1
--- openacs-4/packages/xowiki/tcl/notification-procs.tcl 11 Apr 2013 12:56:23 -0000 1.19
+++ openacs-4/packages/xowiki/tcl/notification-procs.tcl 17 Sep 2013 17:49:24 -0000 1.19.2.1
@@ -140,7 +140,7 @@
array unset cat
array unset label
foreach category_info [::xowiki::Category get_category_infos -tree_id $tree_id] {
- foreach {category_id category_label deprecated_p level} $category_info {break}
+ lassign $category_info category_id category_label deprecated_p level
set cat($level) $category_id
set label($level) $category_label
if {$category_id == $cat_id} break
Index: openacs-4/packages/xowiki/tcl/syndicate-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/syndicate-procs.tcl,v
diff -u -r1.40 -r1.40.2.1
--- openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 13 Sep 2012 16:05:28 -0000 1.40
+++ openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 17 Sep 2013 17:49:24 -0000 1.40.2.1
@@ -314,7 +314,7 @@
$o set operation [expr {$creation_date eq $publish_date ? "created" : "modified"}]
items add $o
- foreach {last_user last_item last_clock} [list $creation_user $item_id $clock] break
+ lassign [list $creation_user $item_id $clock] last_user last_item last_clock
}
# The following loop tries to distinguis between create and modify by age.
Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v
diff -u -r1.63.2.1 -r1.63.2.2
--- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 12 Sep 2013 20:53:52 -0000 1.63.2.1
+++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 17 Sep 2013 17:49:24 -0000 1.63.2.2
@@ -275,7 +275,7 @@
#my proc destroy {} {my log "--W"; next}
if {$sort_composite ne ""} {
- foreach {kind att direction} [split $sort_composite ,] break
+ lassign [split $sort_composite ,] kind att direction
if {$kind eq "method"} {$items mixin add ::xo::OrderedComposite::MethodCompare}
$items orderby -order [expr {$direction eq "asc" ? "increasing" : "decreasing"}] $att
}
Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v
diff -u -r1.132 -r1.132.2.1
--- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 12 Aug 2013 19:46:50 -0000 1.132
+++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 17 Sep 2013 17:49:24 -0000 1.132.2.1
@@ -80,7 +80,7 @@
# append the folder spec to its options
set __newspec [list $__wspec]
foreach __e [lrange $__spec 1 end] {
- foreach {__name __value} $__e break
+ lassign $__e __name __value
if {$__name eq "options"} {eval lappend __value [my folderspec]}
lappend __newspec [list $__name $__value]
}
@@ -331,7 +331,7 @@
WikiForm instproc tidy {} {
upvar #[template::adp_level] text text
if {[info exists text]} {
- foreach {text format} [my var text] break
+ lassign [my var text] text format
if {[info exists format]} {
my var text [list [list [::xowiki::tidy clean $text] $format]]
}
@@ -566,7 +566,7 @@
PodcastForm instproc to_timestamp {widgetinfo} {
if {$widgetinfo ne ""} {
- foreach {y m day hour min} $widgetinfo break
+ lassign $widgetinfo y m day hour min
set t [clock scan "${hour}:$min $m/$day/$y"]
#
# be sure to avoid bad side effects from LANG environment variable
@@ -807,7 +807,7 @@
if {$text eq ""} { return 1 }
if {[llength $text] != 2} { return 0 }
regsub -all "" $text "" text ;# get rid of strange utf-8 characters hex C2AD (firefox bug?)
- foreach {content mime} $text break
+ lassign $text content mime
if {$content eq ""} {return 1}
#ns_log notice "VALUE='$content'"
set clean_content $content
Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v
diff -u -r1.472 -r1.472.2.1
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 12 Aug 2013 19:46:50 -0000 1.472
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Sep 2013 17:49:25 -0000 1.472.2.1
@@ -344,7 +344,7 @@
set categories [list]
if {[my exists __category_map]} {array set cm [my set __category_map]}
foreach category [::xowiki::Category get_category_infos -tree_id $tree_id] {
- foreach {category_id category_name deprecated_p level} $category break
+ lassign $category category_id category_name deprecated_p level
lappend categories $level $category_name
set names($level) $category_name
set node_name $tree_name
@@ -414,7 +414,7 @@
#
# build reverse category_map
foreach category [::xowiki::Category get_category_infos -tree_id $tree_id] {
- foreach {category_id category_name deprecated_p level} $category break
+ lassign $category category_id category_name deprecated_p level
lappend categories $level $category_name
set names($level) $category_name
set node_name $name
@@ -1754,7 +1754,7 @@
Page instproc render_content {} {
#my log "-- '[my set text]'"
set html ""; set mime ""
- foreach {html mime} [my set text] break
+ lassign [my set text] html mime
if {[my render_adp]} {
set html [my adp_subst $html]
}
@@ -1771,7 +1771,7 @@
set spec ""
#my msg WidgetSpecs=[$package_id get_parameter WidgetSpecs]
foreach {s widget_spec} [$package_id get_parameter WidgetSpecs] {
- foreach {page_name var_name} [split $s ,] break
+ lassign [split $s ,] page_name var_name
# in case we have no name (edit new page) we use the first value or the default.
set name [expr {[my exists name] ? [my set name] : $page_name}]
#my msg "--w T.name = '$name' var=$page_name ([string match $page_name $name]), $var_name $field_name ([string match $var_name $field_name])"
@@ -1811,7 +1811,7 @@
db_dml [my qn delete_references] \
"delete from xowiki_references where page = :item_id"
foreach ref $references {
- foreach {r link_type} $ref break
+ lassign $ref r link_type
db_dml [my qn insert_reference] \
"insert into xowiki_references (reference, link_type, page) \
values (:r,:link_type,:item_id)"
@@ -2549,7 +2549,7 @@
# for a field with a specified name in a specified page template
my instvar package_id
foreach {s widget_spec} [$package_id get_parameter WidgetSpecs] {
- foreach {template_name var_name} [split $s ,] break
+ lassign [split $s ,] template_name var_name
#ns_log notice "--w template_name $template_name, given '$given_template_name' varname=$var_name name=$name"
if {([string match $template_name $given_template_name] || $given_template_name eq "") &&
[string match $var_name $name]} {
@@ -2816,7 +2816,7 @@
if {[lindex $text 0] ne ""} {
my do_substitutions 0
set html ""; set mime ""
- foreach {html mime} [my set text] break
+ lassign [my set text] html mime
set content [my substitute_markup $html]
} elseif {[lindex $form 0] ne ""} {
set content [[self class] disable_input_fields [lindex $form 0]]
@@ -3359,7 +3359,7 @@
# The passed value is a tuple of the form
# {property-name operator property-value}
#
- foreach {property_name op property_value} $value break
+ lassign $value property_name op property_value
if {![info exists property_value]} {return 0}
#my log "$value => [my adp_subst $value]"
@@ -3539,7 +3539,7 @@
::xowiki::Form requireFormCSS
- foreach {form_vars field_names} [my field_names_from_form -form $form] break
+ lassign [my field_names_from_form -form $form] form_vars field_names
my array unset __field_in_form
if {$form_vars} {foreach v $field_names {my set __field_in_form($v) 1}}
set form_fields [my create_form_fields $field_names]
Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v
diff -u -r1.31 -r1.31.2.1
--- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 12 Aug 2013 19:46:50 -0000 1.31
+++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 17 Sep 2013 17:49:25 -0000 1.31.2.1
@@ -198,7 +198,7 @@
"
foreach tuple [::xo::db_list_of_lists get_revisions $sql] {
#::xotcl::Object msg "tuple = $tuple"
- foreach {name package_id item_id revision_id last_modified} $tuple break
+ lassign $tuple name package_id item_id revision_id last_modified
set time [clock scan [::xo::db::tcl_date $last_modified tz_var]]
if {$time > $older_than} continue
::xotcl::Object log "...will delete $name doit=$doit $last_modified"
@@ -229,7 +229,7 @@
foreach tuple [::xo::db_list_of_lists get_revisions $sql] {
#::xotcl::Object msg "tuple = $tuple"
- foreach {name item_id revision_id last_modified user package_id} $tuple break
+ lassign $tuple name item_id revision_id last_modified user package_id
set time [clock scan [::xo::db::tcl_date $last_modified tz_var]]
if {$time > $older_than} continue
#::xotcl::Object msg "compare time $time with $older_than => [expr {$time < $older_than}]"
@@ -499,7 +499,7 @@
#my log npo=[array get npo]=>to='$to'
set renames [list]
foreach tuple $pages {
- foreach {old_page_order page_id item_id name} $tuple break
+ lassign $tuple old_page_order page_id item_id name
if {[info exists npo($old_page_order)]} {
#
# We have a name in the translation list
Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v
diff -u -r1.320 -r1.320.2.1
--- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 Aug 2013 19:46:50 -0000 1.320
+++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 17 Sep 2013 17:49:25 -0000 1.320.2.1
@@ -723,7 +723,7 @@
#
# we have to valiate and save the form data
#
- foreach {validation_errors category_ids} [my get_form_data $form_fields] break
+ lassign [my get_form_data $form_fields] validation_errors category_ids
if {$validation_errors != 0} {
#my msg "$validation_errors errors in $form_fields"
@@ -1623,14 +1623,14 @@
#my msg "mapped category ids=$category_ids"
foreach category_tree $category_trees {
- foreach {tree_id tree_name subtree_id assign_single_p require_category_p} $category_tree break
+ lassign $category_tree tree_id tree_name subtree_id assign_single_p require_category_p
set options [list]
#if {!$require_category_p} {lappend options [list "--" ""]}
set value [list]
foreach category [::xowiki::Category get_category_infos \
-subtree_id $subtree_id -tree_id $tree_id] {
- foreach {category_id category_name deprecated_p level} $category break
+ lassign $category category_id category_name deprecated_p level
if {$category_id in $category_ids} {lappend value $category_id}
set category_name [ad_quotehtml [lang::util::localize $category_name]]
if { $level>1 } {
@@ -1868,7 +1868,7 @@
}
}
if {[string match *.* $att]} {
- foreach {container component} [split $att .] break
+ lassign [split $att .] container component
lappend containers($container) $component
}
}
@@ -2051,7 +2051,7 @@
FormPage instproc field_names {{-form ""}} {
my instvar package_id
- foreach {form_vars needed_attributes} [my field_names_from_form -form $form] break
+ lassign [my field_names_from_form -form $form] form_vars needed_attributes
#my msg "form=$form, form_vars=$form_vars needed_attributes=$needed_attributes"
my array unset __field_in_form
my array unset __field_needed
Index: openacs-4/packages/xowiki/www/admin/list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.tcl,v
diff -u -r1.34 -r1.34.2.1
--- openacs-4/packages/xowiki/www/admin/list.tcl 13 Sep 2012 16:05:32 -0000 1.34
+++ openacs-4/packages/xowiki/www/admin/list.tcl 17 Sep 2013 17:49:25 -0000 1.34.2.1
@@ -87,7 +87,7 @@
AnchorField delete -CSSclass delete-item-button -label "" ;#-html {onClick "return(confirm('#xowiki.delete_confirm#'));"}
}
-foreach {att order} [split $orderby ,] break
+lassign [split $orderby ,] att order
t1 orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att
# -page_size 10