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

[REBOL] Re: Interlacing blocks

From: greggirwin:mindspring at: 6-Jan-2004 12:40

Hi Alain, AG> I needed something to evaluate a function on ALL elements of a AG> block, and keep ALL the results (in a block), so I did these. AG> Can this be useful, or is there a better way ? And also better AG> names ? Looks kind of like MAP to me. map: func [fn blk args /local result][ result: copy [] repeat el blk [append/only result fn :el args] result ]
>> map :odd? [1 3 5 7 9 12] none
== [true true true true true false] You might also look for old discussions here on the COLLECT functions some people have done. -- Gregg