[REBOL] Re: foreach with block question
From: g:santilli:tiscalinet:it at: 14-Oct-2001 11:35
Hello Miquel!
On 13-Ott-01, you wrote:
MG> row is considered a word, not a block.
MG> How can I use foreach with a block ?
>> 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]
>> row: [ a b c d e ]
== [a b c d e]
>> foreach :row data [ print bind row 'a ]
1 AAA BBB 3 0
2 MMM XXX 1 1
3 DDD VVV 2 1
or, faster:
>> foreach :row data compose/deep [ print [(row)] ]
1 AAA BBB 3 0
2 MMM XXX 1 1
3 DDD VVV 2 1
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/