Loops/Foreach: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: changed language for DOW, added comments. -- ~~~~ |
Add Racket example |
||
Line 1,040: | Line 1,040: | ||
<lang R>a <- list("First", "Second", "Third", 5, 6) |
<lang R>a <- list("First", "Second", "Third", 5, 6) |
||
for(i in a) print(i)</lang> |
for(i in a) print(i)</lang> |
||
=={{header|Racket}}== |
|||
<lang racket> |
|||
#lang racket |
|||
;; an example sequence |
|||
(define sequence '("something" 1 2 "foo")) |
|||
;; works for any sequence |
|||
(for ([i sequence]) |
|||
(displayln i)) |
|||
</lang> |
|||
=={{header|REBOL}}== |
=={{header|REBOL}}== |
||
Line 1,085: | Line 1,098: | ||
say word(days,j) /*display the weekday to screen. */ |
say word(days,j) /*display the weekday to screen. */ |
||
end /*j*/ |
end /*j*/ |
||
/*stick a fork in it, we're done.*/</lang> |
lang postscript> /*stick a fork in it, we're done.*/</lang> |
||
=={{header|Ruby}}== |
=={{header|Ruby}}== |