Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] foreach with block question

From: m_gaya_t::hotmail::com at: 13-Oct-2001 19:18

foreach can be used with a block of words. for example:
>> data: [ 1 AAA BBB 3 0
[ 2 MMM XXX 1 1 [ 3 DDD VVV 2 1 ] == [1 AAA BBB 3 0 2 MMM XXX 1 1 3 DDD VVV 2 1]
>> foreach [ a b c d e ] data [ print [ a b c d e ]]
1 AAA BBB 3 0 2 MMM XXX 1 1 3 DDD VVV 2 1 but if I want generalize the foreach expression...
>> row: [ a b c d e ]
== [a b c d e]
>> foreach row data [ print row ]
1 AAA BBB 3 0 2 MMM XXX 1 1 3 DDD VVV 2 1
>>
row is considered a word, not a block. How can I use foreach with a block ? thanks, Miquel.