Luke McCarthy scripsit:
> Keyword arguments in Chicken don't work where the keywords precede the rest
> list, e.g. (a href: "url" "text").
>
> (define (a #!rest args #!key href) ...)
>
> In the call (a href: "foo" "bar") href is bound to "foo" as expected but args
> is bound to (href: "foo" "bar") not ("bar").
>
> The behaviour makes sense from the point of view of the implementation. It
> would be less efficient to support the idiom since the rest list would have
> to be post-processed to remove keyword arguments.
Remember that keywords are evaluated like any other arguments: it just
so happens that keywords evaluate to themselves. Common Lisp in this
case processes the keyword arguments *and* leaves them in the rest list.
It's a corner case however you look at it.
> It might be worth noting that Python's keyword arguments are limited in the
> same way (but throw exceptions instead).
Python keywords have to be literal, though, don't they?
--
John Cowan [EMAIL PROTECTED] http://ccil.org/~cowan
If he has seen farther than others,
it is because he is standing on a stack of dwarves.
--Mike Champion, describing Tim Berners-Lee (adapted)
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users