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

[REBOL] Re: Reflectivity: How a function can know its own name ?

From: al:bri:xtra at: 27-Mar-2002 17:11

laplace asked about function names. Here's an alternative solution:
>> functions: reduce [
[ func [x] [print ["I'm the first function!" X]] [ func [y] [print ["Second function!" y]] [ ] == [func [x][print ["I'm the first function!" X]] func [y][print ["Second function!" y]]]
>> generic: func [A F [function!]] [
[ f a [ ]
>> generic 123 pick functions 1
I'm the first function! 123
>> generic 123 pick functions 2
Second function! 123
>>
Andrew Martin ICQ: 26227169 http://valley.150m.com/