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

[REBOL] varargs in rebol? Re:

From: brian:hawley:bigfoot at: 31-Aug-2000 18:57

[princepawn--MailAndNews--com] wrote:
>Is it possible to design a rebol function that takes a variable number of >arguments, ie: > >va-func 1 2 >va-func 1 2 3 >va-func 1 2 3 4
This method would break the REBOL syntax, which depends on functions having a fixed number of arguments. This is so that we don't need to put parentheses around argument lists.
>What immediately comes to mind is to use a block for the varargs part of the >call, ie > >va-func 1 [2] >va-func 1 [2 3] >va-func 1 [2 3 4]
That's the way that standard functions in REBOL do it. Take a look at the source to the join function for a way to do argument lists that way. Brian Hawley