Passing in a block would probably be the best (most generic) solution. If
you have a fixed number of parameters that you could receive, but at times
you don't need to pass them all in, you could surround your parameters with
parenthesis (in the function call) then check for values of the dummy
parameters (inside the function) of unset!.

- Michael Jelinek





[EMAIL PROTECTED]@MailAndNews.com> on 08/31/2000 09:29:13 AM

From: [EMAIL PROTECTED]@MailAndNews.com on 08/31/2000 09:29 AM

Please respond to [EMAIL PROTECTED]

Sent by:  Terrence Brannon <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:
Subject:  [REBOL] varargs in rebol?


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

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]

But I thought I would just jog the brains of those around me :-)

terrence-brannon: [[EMAIL PROTECTED] perl-refugee myth-gamer]
free-email:       http://www.MailAndNews.com
free-usenet:      http://www.mailAndNews.com
; all the above is real REBOL code, believe it or not.






Reply via email to