From: Andrew Gwozdziewycz <apgwoz@gmail.com>
To: Bill Schottstaedt <bil@ccrma.stanford.edu>
Cc: guile-user@gnu.org
Subject: Re: progv in scheme
Date: Tue, 13 Sep 2011 15:16:49 -0400 [thread overview]
Message-ID: <CADoGzseDwxEnro1r03quDpoT-FUUZE1viwCCtSc76=NjzovMHw@mail.gmail.com> (raw)
In-Reply-To: <20110913190704.M82579@ccrma.Stanford.EDU>
On Tue, Sep 13, 2011 at 3:09 PM, Bill Schottstaedt
<bil@ccrma.stanford.edu> wrote:
> if lambda were applicable, this would work in both cases:
>
> (define-macro (progv vars vals . body)
> `(apply (apply lambda ,vars ',body) ,vals))
>
>> (let ((s '(one two)) (v '(1 2))) (progv s v (+ one two)))
> 3
>> (progv '(one two) '(1 2) (+ one two))
> 3
>
> (running a mystery scheme...)
Bill-
It seems as though this would work actually in many schemes that do
incremental expansion of macros as part of their eval. If eval was
written as such:
(define (eval form env)
(cond
((self-evaluating? form) form)
((variable? form) (lookup env (car form)))
(...
((macro? form env) (eval (expand-macro (car form) (cdr form)) env))
...))
Then it seems as though it'd work perfectly fine. I haven't been using
guile very long, but it seems as though it's doing bytecode
compilation, which makes the story a bit different.
(I could totally be wrong of course)
--
http://www.apgwoz.com
next prev parent reply other threads:[~2011-09-13 19:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-13 13:54 progv in scheme Panicz Maciej Godek
2011-09-13 14:25 ` Andrew Gwozdziewycz
2011-09-13 14:26 ` Andrew Gwozdziewycz
2011-09-13 16:04 ` Panicz Maciej Godek
2011-09-13 16:35 ` Andrew Gwozdziewycz
2011-09-13 17:01 ` Bill Schottstaedt
2011-09-13 17:54 ` Bill Schottstaedt
2011-09-13 17:20 ` Ludovic Courtès
2011-09-13 17:57 ` Ian Price
2011-09-13 18:48 ` Panicz Maciej Godek
2011-09-13 19:09 ` Bill Schottstaedt
2011-09-13 19:16 ` Andrew Gwozdziewycz [this message]
2011-09-15 18:11 ` Andy Wingo
2011-09-15 18:16 ` Andrew Gwozdziewycz
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='CADoGzseDwxEnro1r03quDpoT-FUUZE1viwCCtSc76=NjzovMHw@mail.gmail.com' \
--to=apgwoz@gmail.com \
--cc=bil@ccrma.stanford.edu \
--cc=guile-user@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).