2008/7/11 Kjetil S. Matheussen <[EMAIL PROTECTED]>: > > On Fri, 11 Jul 2008, Kjetil S. Matheussen wrote: > >> Ludovic Court?s: >> > >> > guile> ((lambda (a b) (the-environment)) 2 3) >> > (((a b) 2 3) #<eval-closure b7c6dcf8>) >> > >> > But don't do that, since the representation of environments could >> > eventually change.
> Sorry, I misunderstood. What I ment is that (the-environment) > etc. is what makes Guile special. I hope there is no > plans to remove all that. I agree. I can't see a reason why we might want to remove `the-environment' and `local-eval', even if Guile's internal representation of environments changes, because the ideas that there _is_ a lexical environment inside a lambda (or a let ...), and that one can evaluate with respect to these environments, are absolutely fundamental in Scheme. On the other hand, it would be unsafe (w.r.t. the future) to write code that depends on the current representation. If you find yourself doing that, better to ask for an official abstraction of whatever you're trying to do. (And even better to provide a patch for it!) For example, I see no problem with Kjetil's add-var-to-environment, because it doesn't depend on the representation. Neil