[REBOL] varargs in rebol? Re:

2000-08-31 Thread brian . hawley
[EMAIL PROTECTED] 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

[REBOL] varargs in rebol? Re:

2000-08-31 Thread tim
Hi: You wouldn't need to pass the number of args: Just get the length of the block from within the function body i.e: test: func[args[block!] /local num-args] [ num-args: length? args print num-args foreach arg args [print type? arg] ] test ["one" 2 3:00] After dealing with my own va

[REBOL] varargs in rebol? Re:

2000-08-31 Thread jelinem1
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 pa