[REBOL] Re: [Function] with [Variable number of args]
From: Christophe:Coussement:mil:be at: 6-Apr-2004 8:12
Hi Gerard,
I once use this little trick for handling a variable number of argument:
f: func [a [integer!] b [unset! integer!]][either value? 'b [a + b][a]]
>> f 1 2
== 3
>> f 1
== 1
Please remark that the type of the argument must be explicitely declared, otherwise:
f: func [a b][either value? 'b [a + b][a]]
>> f 5 6
== 11
>> f 8
** Script Error: f is missing its b argument
** Near: f 8
Could this be useful to you ?
gretz,
==christophe