June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
25
Task/Loops-Foreach/Red/loops-foreach.red
Normal file
25
Task/Loops-Foreach/Red/loops-foreach.red
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
>> blk: ["John" 23 "dave" 30 "bob" 20 "Jeff" 40]
|
||||
>> foreach item blk [print item]
|
||||
John
|
||||
23
|
||||
dave
|
||||
30
|
||||
bob
|
||||
20
|
||||
Jeff
|
||||
40
|
||||
>> foreach [name age] blk [print [name "is" age "years old"]]
|
||||
John is 23 years old
|
||||
dave is 30 years old
|
||||
bob is 20 years old
|
||||
Jeff is 40 years old
|
||||
|
||||
>> forall blk [print blk]
|
||||
John 23 dave 30 bob 20 Jeff 40
|
||||
23 dave 30 bob 20 Jeff 40
|
||||
dave 30 bob 20 Jeff 40
|
||||
30 bob 20 Jeff 40
|
||||
bob 20 Jeff 40
|
||||
20 Jeff 40
|
||||
Jeff 40
|
||||
40
|
||||
Loading…
Add table
Add a link
Reference in a new issue