Hi, Romano,

Romano Paolo Tenca wrote:
> 
> Upto here, we agree. Functions have a fixed number of args. Right?
> 

No, not AFAICT...

> 
> I don't understand. If the answer is no,  functions have always a fixed number
> of args, like i think.
> You think that this is false. So, you should be able to write this kind of
> function. Right?
> 

Here's a function with a varying (within bounds) number of args...

    zzz: func [a [any-type!] b [any-type!]] [
        either value? 'a [
            either value? 'b [
                print ["Foo with" a "and" b]
            ][
                print ["Foo with just" a]
            ]
        ][
            print "Just foo!"
        ]
    ]

... which behaves as follows ...

    >> zzz
    Just foo!
    >> zzz 1
    Foo with just 1
    >> zzz 1 2
    Foo with 1 and 2

Of course, this is not a completely unbounded number of arguments,
but it is not absolutely fixed.

-jn-

-- 
"This sentence contradicts itself -- no actually it doesn't."
-- Doug Hofstadter
                              joel<dot>neely<at>fedex<dot>com
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to