chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Re: eval and local variables


From: Graham Fawcett
Subject: Re: [Chicken-users] Re: eval and local variables
Date: Tue, 8 May 2007 13:47:44 -0400

On 5/8/07, Graham Fawcett <address@hidden> wrote:
Here's a cheap-and-dirty way to do it; it's not perfect (especially
because there's some redundant typing involved) but you can have it
today:

(define-macro (eval-with-locals locals expr)
  `((eval '(lambda ,locals ,(eval expr))) ,@locals))

Except that this fails:

(let ((x 10)
     (y 100)
     (expr '(+ x y z)))
 (eval-with-locals (x y) expr))
==> Error: during expansion of (eval-with-locals ...) - unbound variable: expr

...and this is what you really want to work. Sorry, don't have time to
fix it right now. :-(

G




reply via email to

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