guile-user
[Top][All Lists]
Advanced

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

Re: progv in scheme


From: Andrew Gwozdziewycz
Subject: Re: progv in scheme
Date: Tue, 13 Sep 2011 15:16:49 -0400

On Tue, Sep 13, 2011 at 3:09 PM, Bill Schottstaedt
<address@hidden> 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



reply via email to

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