RosettaCodeData/Task/Loops-Foreach/Retro/loops-foreach.retro

24 lines
327 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
# Strings
2013-04-10 22:43:41 -07:00
2019-09-12 10:33:56 -07:00
This will display the ASCII code for each character in a string
2013-04-10 22:43:41 -07:00
2019-09-12 10:33:56 -07:00
~~~
'This_is_a_message [ n:put sp ] s:for-each
~~~
2013-04-10 22:43:41 -07:00
2019-09-12 10:33:56 -07:00
# Array
2013-04-10 22:43:41 -07:00
2019-09-12 10:33:56 -07:00
Display each element
~~~
{ #1 #2 #3 } [ n:put sp ] a:for-each
~~~
# Linked List
Using the dictionary as an example, display each name
~~~
&Dictionary [ d:name s:put sp ] d:for-each
~~~