Eval in Haskell
Ashley Yakeley
ashley@semantic.org
Sun, 01 Jun 2003 20:43:03 -0700
In article <20030601235255.GA4498@la.iki.fi>, Lauri Alanko <la@iki.fi>
wrote:
> Nevertheless, this abomination is supported even by some scheme
> implementations:
>
> guile> (define local-environment (procedure->syntax (lambda (exp env) env)))
> guile> (define (eval-where-x-bound exp)
> ... (let ((x 'foo)) (local-eval exp (local-environment))))
> guile> (eval-where-x-bound '(list 'x x))
> (x foo)
Guile seems to be a bit "sloppy" in general. I think it just keeps a
dictionary of symbol bindings and passes it around at runtime.
guile> (eval '(define b 5))
guile> b
5
--
Ashley Yakeley, Seattle WA