Another, better, example:
Imagine you want to write something like apply,
but which accepts some optional argument (let's say debug)
(define* (my-apply f :rest args (debug #f))
(when debug
(format *stderr* "passed args: ~A\n" args))
(apply f args))
(my-apply + 1 2 3) ;; debug is 2, not #f
(my-apply + 1 2 3 :debug #t) ;; args are (1 2 3 :debug #t), debug is 2
;; error: + argument 2, :debug, is a symbol but should be a number
(my-apply :debug #t + 1 2 3 ) ;; error: parameter set twice, debug in
(:debug #t + 1 2 3)
On Fri, 30 Jul 2021 at 17:21, <[email protected]> wrote:
> I'm not sure I understand the desired functionality.
> The arguments after the rest argument should be like
> auxiliary arguments in CL (or whatever they are called) --
> basically variable declarations? Ah, I looked it up --
> &aux in the CL lambda list -- I never used those!
>
>
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist