Loops/Foreach: Difference between revisions
Content added Content deleted
(Added PicoLisp) |
(added REXX) |
||
Line 534: | Line 534: | ||
<pre>Sorkday Gunday Bluesday Nedsday Thirstday Frightday Caturday |
<pre>Sorkday Gunday Bluesday Nedsday Thirstday Frightday Caturday |
||
Sorkday Gunday Bluesday Nedsday Thirstday Frightday Caturday</pre> |
Sorkday Gunday Bluesday Nedsday Thirstday Frightday Caturday</pre> |
||
=={{header|REXX}}== |
|||
Standard REXX: |
|||
<lang rexx>days = "sunday monday tuesday wednesday thursday friday saturday" |
|||
do d = 1 to words(days) |
|||
say word(days,d) |
|||
end</lang> |
|||
or: |
|||
<lang rexx>days = "sunday monday tuesday wednesday thursday friday saturday" |
|||
hlp = days |
|||
do while hlp <> "" |
|||
parse var hlp item hlp |
|||
say item |
|||
end</lang> |
|||
{{works with|oorexx}}: |
|||
<lang rexx>colors = .bag~of("red","green","blue","pink") |
|||
do c over colors |
|||
say c |
|||
end</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |