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

[REBOL] Re: Why is the lit-word! datatype! not working

From: lmecir::mbox::vol::cz at: 22-Oct-2005 7:38

Hi Gerard, I am not sure what you consider user friendly, but you have got the following options for function header: 1) f as a "fetched" argument my-map: func [:f blk] [...] 2) f as an "unevaluated" argument my-map: func ['f blk] [...] 3) f as a "normally evaluated" argument (I prefer this as the most standard using the other variants only in rare cases) my-map: func [f blk] [...]
>Hi List, > >As I tried to eliminate the need to use the (:) before function names into Higher Order Functions I got this more user friendly >version to work for me : > >>>my-map: func [f blk /local result] [ >>> >>> >[ result: make block! length? blk >[ foreach item blk [ >[ append/only result do reduce [:f :item] >
The expression: do reduce [:f :item] can be replaced by f :item in most situations. The other question has been answered by Anton. -Ladislav