Newsgroups: comp.lang.lisp Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Subject: Re: compiling lambda-CLOSUREs Message-ID: <1991Apr5.001438.26057@Think.COM> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA References: <14172@medusa.cs.purdue.edu> <1991Apr3.095336.29725@hellgate.utah.edu> Date: Fri, 5 Apr 91 00:14:38 GMT In article jinx@zurich.ai.mit.edu writes: >Since MIT Scheme has first-class environments, we had to deal with the >situation of mutable environments being shared between interpreted and >compiled code, and directly manipulated by programs, and it is not >hard to solve, but requires some care. No, it's not hard to do, but few CL implementations actually do it, so we decided not to require it. Basically, all it requires is that the compiler generate code that emulates the way the interpreter searches lexical environments, rather than turning lexical references into constant offsets into the lexical environment. Also, the compilation of GO and RETURN-FROM must call into the interpreter if they are transfering out of the lambda expression. To answer Yeh's question about how Tim knew this: he is on the X3J13 committee, which is currently drafting the ANSI Common Lisp standard. The decision of the committee is mentioned in CLtL 2nd edition, on p.677, paragraph 3. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar