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

[REBOL] Re: func args by ladislav

From: rotenca:telvia:it at: 17-Oct-2001 17:16

Hi, Ladislav, Now i've thinked a little about the 'do mistery.
> 4) Can you write a Rebol function (a FUNCTION! datatype value) able to > evaluate any F (i.e. F with any number of arguments) without cheating, i.e. > without "packing" the arguments into a block?
No. And RT also. I think that it is impossible to write a function which read an unlimited number of arguments without a pointer to the line in which arguments can be found. So i think there are 3 cases: 1) RT "cheats". In the sense that it gives to the function 'do an hidden arg which points to the executed line (the pointer used by the interpreter). 2) In expressions like: do :- 1 2 'do sends to the interpreter a signal which say "evaluate the next value (the 'do arg) in a special mode", a sort of flag for the interpreter. I think that the 2nd case is the most probable. Among others things, in the example shown, do/next does not make its work. It seems that it makes its work only with block or other arguments which are reduced to block (file, string...). Adifference treatment between blocks and others value. 3) Mecir can explain to me how to pass an unlimited number of arguments to a function without "cheating". For what you know, the behaviour of 'do can be found in other fuctions too? --- Ciao Romano