chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] Allowing unspecified key arguments in functions


From: kooda
Subject: Re: [Chicken-hackers] Allowing unspecified key arguments in functions
Date: Fri, 26 Jul 2019 13:24:36 +0200
User-agent: OtterMail

Amir Teymuri <address@hidden> wrote:
> I had a question about the objectives and reasons of allowing
> un-specified key arguments in functions as soon as i want to have some
> key arguments.

Any DSSSL style arguments (#!rest, #!optional and #!key) always are
optional arguments to the procedure.

You can think of them as working this way:

(lambda (foo #!key bar qux) your-code)
=>
(lambda (foo . rest)
  (let ((bar (get-keyword-arg #:bar rest))
        (qux (get-keyword-arg #:qux rest)))
    your-code))

If you want to have a more strict handling of them, you might want to
write your own superset of “lambda” and/or “define”, that check
what you need.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]