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

[REBOL] Re: variable number of arguments

From: larry:ecotope at: 26-Nov-2000 18:03

Hi Andrew, Ladislav This example may help resolve the question in a direct fashion. We can use do/next to identify the first expression in a block.
>> x: 1 y: 2 z: 3
== 3
>> do/next [do x y z]
== [1 [y z]] This shows that the inner do consumed only one argument.
>> take2: func [x y] ["hello"] >> do/next [take2 x y z]
== ["hello" [z]] This shows the function take2 consumed (as expected) two arguments. Cheers -Larry