Ups, posting in hurry brings always bugs ;) Here is the fixed version:
example:
>> nargs 'open
== 1
>> nargs 'open/binary
== 1
>> nargs 'open/binary/mode
== 2
>> nargs 'open/binary/mode/with
== 3
>>
etc.
------------------start of code--------------------
nargs: func [f [word! path!] /local rslt loc? ref? args refs fn rf][
fn: either word? f [
get f
][
rf: copy next to-block f
get first f
]
args: copy []
refs: copy []
parse third :fn [
any [
set w word! (
either ref? [
insert tail last refs w
][
insert tail args w
]
)
| m: refinement! (
ref?: true
insert tail refs reduce [m/1 copy []]
)
| skip
]
to end
]
return either rf [
rslt: 0
(length? args) + foreach a rf [
rslt: rslt + length? any reduce [select refs to-refinement a []]
]
][
length? args
]
]
------------------------------end of code----------------------------------
----- Original Message -----
From: "Maarten Koopmans" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 2:41 PM
Subject: [REBOL] Re: nargs
>
> > >> nargs 'copy/deep
> > == 0
>
> ??
>
> --Maarten
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
>
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.