guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] utils: Support defaults in substitute-keyword-arguments.


From: Eric Bavier
Subject: Re: [PATCH 2/2] utils: Support defaults in substitute-keyword-arguments.
Date: Sun, 25 Sep 2016 23:08:23 -0500

On Sat, 24 Sep 2016 11:21:40 +0900
address@hidden (Ludovic Courtès) wrote:
> 
> > +replaced by EXP.  EXP is evaluated in a context where VAR is bound to the
> > +previous value of the keyword argument, or DFLT if given."
> > +    (syntax-case x ()
> > +      ((_ original-args ((kw var dflt ...) exp) ...)
> > +       #`(let loop ((args (default-keyword-arguments
> > +                            original-args
> > +                            (list #,@(append-map (match-lambda
> > +                                                   ((k) '())
> > +                                                   (x x))
> > +                                                 #'((kw dflt ...) ...)))))
> > +                    (before '()))  
> 
> I would prefer to stick to ‘syntax-rules’ when matching the clauses,
> with a helper macro:

Right, I was wanting to do that, but was having a difficult time
working with mixed cases, where some keywords are declared with a
default and others are not.

> But this would be a bonus;

How about this patch instead?

`~Eric

Attachment: 0001-utils-Support-defaults-in-substitute-keyword-argumen.patch
Description: Text Data


reply via email to

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