[plt-scheme] Keyword arguments and multiple values?
On Thu, Sep 17, 2009 at 9:48 AM, Scott McLoughlin <scott at adrenaline.com> wrote:
> I noticed when using scheme/cmdline that the #once-any keyword argument
> can take multiple argument values. I didn't notice this feature described
> in the general
> keyword argument documentation.
>
> Am I missing something? Any pointers into the documentation welcome.
>
> Thanks in advance!
>
> Scott
Scott,
Note that the command-line form is a macro, not a function. Functions
always take arguments the same way: any number of positional
arguments, interleaved with keywords that take exactly one argument.
Macros get to parse their own arguments, so they can interpret
keywords any way they want to. In the case of command-line, all of
its arguments use keywords, so they can take any number of expressions
as arguments; it simply keeps parsing arguments until it gets to the
next keyword.
I hope that helps clear it up.
--Carl