On 14 November 2012 18:20, Daniel Llorens <daniel.llor...@bluewin.ch> wrote:
>> When the doc. states keyword arguments do not contribute to the
>> success of a match, it refers only to keyword arguments in the
>> case-lambda clause, not at the call site.  This makes sense, otherwise
>> it would inhibit writing functions that detect keywords internally
>> from their rest arguments.
>
> Do you mean something like this?
>
> (define* (f a #:key x) x)
> (define (g . args) (apply f args))
> (g 0) -> #f
> (g 0 #:x #t) -> #t
>
> i.e. g must accept being called with 3 'arguments' so that it can forward the 
> keyword args.

I was thinking of:

(define f
  (case-lambda*
   ((a . rest)
    (if (memq #:x rest) …

where #:x is picked up from inside rest.

Based on the other error, I'd say that any case-lambda* with keyword
arguments is matched with a rest argument instead, i.e. “a #:key x” is
treated as “a . rest”.

Reply via email to