[REBOL] Re: [Function] with [Variable number of args]
From: cyphre:seznam:cz at: 6-Apr-2004 9:23
Hi Gerard,
I'm using simmilar trick to Christophe's.
example:
f: func [
a [any-type!]
b [any-type!]
c [any-type!]
d [any-type!]
e [any-type!]
][
foreach v bind first :f 'a [
print [
v
either unset? get/any v [
"not defined"
][
get v
]
]
]
]
>> f 1
a 1
b not defined
c not defined
d not defined
e not defined
>> f 1 2 3
a 1
b 2
c 3
d not defined
e not defined
>> f 1 2 3 4 5
a 1
b 2
c 3
d 4
e 5
>>
regards,
Cyphre