Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Loops-Foreach/LIL/loops-foreach.lil
Normal file
12
Task/Loops-Foreach/LIL/loops-foreach.lil
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Loops/Foreach, in LIL
|
||||
set collection [list 1 2 "three"]
|
||||
append collection [list 4 5 six] # appended as a single item in collection
|
||||
print "Collection is: $collection"
|
||||
|
||||
# using default "i" variable name set for each item
|
||||
foreach $collection {print $i}
|
||||
|
||||
# user named variable in the steps, retrieving accumulated result of loop
|
||||
# each loop step quotes two copies of the item
|
||||
set newlist [foreach j $collection {quote $j $j}]
|
||||
print "Result of second foreach: $newlist"
|
||||
Loading…
Add table
Add a link
Reference in a new issue