Re: Quick question: eval and read-from-string scoping
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Fri, 30 Dec 2005 00:45:01 +0100
Jeremy Smith wrote:
And now I realise that eval is like a function, and local variables are not passed from function to function. So the question is revised: How do I pass variables to code executed by eval without declaring them as special?
This isn't specified in ANSI Common Lisp. Some CL implementations allow this as an extension. For example, clisp allows you to use first-class lexical environments in interpreted code - see http://clisp.cons.org/impnotes.html#eval-environ
Some other Lisp dialects provide this as well, for example OpenLisp, as do some Scheme implementations.
It's not specified in ANSI Common Lips because it prevents important optimizations. In many cases, you can find workarounds.
Pascal
-- My website: http://p-cos.net Closer to MOP & ContextL: http://common-lisp.net/project/closer/ .
- References:
- Quick question: eval and read-from-string scoping
- From: Jeremy Smith
- Quick question: eval and read-from-string scoping
- Prev by Date: Re: something i don't understand...
- Next by Date: Re: Quick question: eval and read-from-string scoping
- Previous by thread: Re: Quick question: eval and read-from-string scoping
- Next by thread: Re: Lisp executables?
- Index(es):