aboutsummaryrefslogtreecommitdiff
path: root/tclcompat.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tclcompat.tcl')
-rw-r--r--tclcompat.tcl6
1 files changed, 4 insertions, 2 deletions
diff --git a/tclcompat.tcl b/tclcompat.tcl
index 8669ed2..a1bc043 100644
--- a/tclcompat.tcl
+++ b/tclcompat.tcl
@@ -10,8 +10,10 @@ set env [env]
# Tcl 8.5 lassign
proc lassign {list args} {
- uplevel 1 [list foreach $args [concat $list {}] break]
- lrange $list [llength $args] end
+ # in case the list is empty...
+ lappend list {}
+ uplevel 1 [list foreach $args $list break]
+ lrange $list [llength $args] end-1
}
# case var ?in? pattern action ?pattern action ...?