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

[REBOL] Re: Is there a REBOL construct similar to the "map" word as used in Logo

From: gerardcote:sympatico:ca at: 28-Jun-2002 12:14

Andrew wrote : ----- Original Message ----- From: "Andrew Martin" <[Al--Bri--xtra--co--nz]> To: <[rebol-list--rebol--com]> Sent: Friday, June 28, 2002 12:28 AM Subject: [REBOL] Re: Is there a REBOL construct similar to the "map" word as used in Logo ?
> This 'Map function might be suitable for your requirements. Thanks again to > Joel and Ladislav! > [ > Rebol [ > Name: 'Map > Title: "Map" > File: %"Map.r" > Author: "Andrew Martin" > eMail: [Al--Bri--xtra--co--nz] > Date: 18/Oct/2001 > Acknowledgements: [ > "Joel Neely" > "Ladislav" > ] > Purpose: {Maps or applies the function to all elements of the series.} > Example: [ > Map func [n [number!]] [n * n] [1 2 3] > ;== [1 4 9] > Map [1 2 3] func [n [number!]] [n * n] > ;== [1 4 9] > Map [1 2 3 4 5 6] func [a] [print [a]]
... Hi Andrew, I find this solution a very interesting one. At least enough for my current needs. I'll make en extensive study of it and may be I'll come back with comments if necessary. Thanks to all contributors for this great solution. Gerard