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