[Top][All Lists]

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

Re: [PATCH] Implement R7RS 'define-values'

From: Ludovic Courtès
Subject: Re: [PATCH] Implement R7RS 'define-values'
Date: Fri, 07 Feb 2014 00:37:28 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Mark H Weaver <address@hidden> skribis:

> This patch implements 'define-values' as a macro, with a similar
> implementation strategy to the one used in the sample definition given
> in the R7RS.  I hope to provide a more efficient implementation on the
> master branch at some point -- one which does not involve any mutation
> -- but for now I'd like to provide at least something so that code that
> uses it will run on the upcoming Guile 2.0.10.

Sorry for the delay; looks good to me.

Indeed it would be great to see in 2.2 if we can avoid walking the list
of values.

> +      ((_ (var0 ... varn) expr)
> +       (and-map identifier? #'(var0 ... varn))
> +       #`(begin
> +           (define dummy
> +             (call-with-values (lambda () expr)
> +               (case-lambda
> +                 ((var0 ... varn)
> +                  (list var0 ... varn))
> +                 (_ (%define-values-arity-error)))))

Looks like this is precisely a case where top-level “hygiene” comes in
handy, no?


reply via email to

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