Maarten wrote:
> Here is a nargs function that also counts the optional arguments if you
use refinements (e.g. nargs copy == 1 nargs copy/part == 2).
> [Snip large chunk of code.]

Ouch! That's a large amount of code.

Isn't this easier?

>> length? Arguments :copy
== 1
>> source Arguments
Arguments: func [
    {Returns the arguments of the function as a block of word! values.}
    F [any-function!] "The Function"
][
    head clear any [
        find first :F refinement!
        tail first :F
    ]
]

And if one needs the length of a path:

>> length? 'copy/part
== 2

Or perhaps I've misunderstood something?

Andrew J Martin
Grail Jedi
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/
-><-

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to