From Newsgroup: comp.lang.tcl
rene <
user4652@newsgrouper.org.invalid> writes:
Why do I get in tcl 9.0 the following results?
set l {1 2 3}
1 2 3
foreach a $l {puts =$a}
=1
=2
=3
< foreach a {*}$l {puts =$a}
=1
foreach a {*}{1 2 3} {puts =$a}
=1
It is the expected result (for 9.0 as well as for 8.6).
Try
foreach a 1 2 3 {
puts "=$a"
puts "=$2"
}
This is the foreach synopis
foreach varlist1 list1 ?varlist2 list2 ...? body
varlist1 is "a", list1 is "1", varlist2 is "2" and list2 is "3"
rolf
--- Synchronet 3.21a-Linux NewsLink 1.2