From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Idiot's guide to special variables take 2 Date: 16 Nov 2002 05:11:55 +0000 Organization: Naggum Software, Oslo, Norway Lines: 34 Message-ID: <3246412315069073@naggum.no> References: <873cqarw00.fsf@darkstar.cartan> <87smy9ykxx.fsf@darkstar.cartan> <87d6pd5kur.fsf@darkstar.cartan> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: maud.ifi.uio.no 1037423516 4047 129.240.65.5 (16 Nov 2002 05:11:56 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 16 Nov 2002 05:11:56 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:46865 * Nils Goesche | And here is where I erred: There /is/ a global lexical environment; it is | called the null lexical environment, and it is here where the binding is | established. This is very confused. The "null lexical environment" communicates to the alert reader that there are no lexically apparent bindings, not that any new bindings are established in it. That `eval´ is evaluated in the null lexical environment means that it cannot access lexically apparent bindings, which `eval´ does not attempt to capture bindings when it receives a form. This is going off on a tangent, but assume you have a lexical environment with variables named `foo´ and `bar´, and wish to evaluate an expression that references these bindings via the obvious mechanism, the symbols `foo´ and `bar´, respectively -- how would you do that? The association between symbol and variable is a compile-time-only notion for lexical bindings, and the lexical environment does not survive compilation. If certain bindings have been captured by a closure, the association between symbol and variable is still lost and have to re-established explicitly. This is why, for instance, macro-expanding functions accept an environment and `eval´ does not, and more importantly, could not, and why environments are not first-class objects but rather compile-time-only notions that have to be constructed and used opaquely. The ability for macros to access the lexical environment of the caller therefore must be of a very different nature than the accessability of and to the global environment via special variables and value slots in symbols. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.