On Apr 1, 2008, at 3:01 PM, Luke McCarthy wrote:
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").

It works as documented, just not as desired.


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.

It might be worth noting that Python's keyword arguments are limited in the
same way (but throw exceptions instead).

I suppose it would not be much trouble to write a macro (like let- optionals) to get the behaviour you wanted. I just thought it might be worth metioning
or discussing.

See "misc-extn-dsssl" for some support procedures.


Luke


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon




_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to