unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: [PATCH] Implement R7RS 'define-values'
Date: Fri, 07 Feb 2014 00:37:28 +0100	[thread overview]
Message-ID: <87r47fsthj.fsf@gnu.org> (raw)
In-Reply-To: 87txe4cmc9.fsf@netris.org

Mark H Weaver <mhw@netris.org> 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?

Thanks,
Ludo’.




      reply	other threads:[~2014-02-06 23:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20  2:01 [PATCH] Implement R7RS 'define-values' Mark H Weaver
2014-02-06 23:37 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r47fsthj.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).