home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!cartier@math.uqam.ca
- From: cartier@math.uqam.ca (Guillaume Cartier)
- Newsgroups: comp.lang.lisp.mcl
- Subject: Re: Making a lambda-expr more like a fn
- Message-ID: <9211181612.AA10831@mipsmath.math.uqam.ca>
- Date: 18 Nov 92 16:12:02 GMT
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 45
- Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
-
- <---
- | While reading the messages about turning lambda expressions
- | into functions, it seemed to me that the following might be reasonable...
- |
- | (defmacro with-environment ((var) &body body &environment env)
- | `(let ((,var ',env))
- | ,@body))
- |
- | In an artificial example..
- |
- | (let ((x 0))
- | (with-environment (env)
- | (setf counter-fn
- | (enclose '(lambda () (incf x)) env))))
- |
- | However...
- |
- | ? (let ((x 'non-nil-environment))
- | (declare (ignore x))
- | (with-environment (var) var))
- | #<BOGUS object @ #x5DF871>
- | ?
- |
- | Does this work in any Lisp?
- | Should it?
- --->
-
- Strange you should ask about that, I was reading about
- exactly that subject last night!
-
- It is correct that what you're trying to do should not work.
- CLtL2 states on top of page 197:
-
- X3J13 voted in March 1989 <117> to specify that macro environment
- objects received with the &environment argument of a macro function
- have only dynamic extent.
-
- Guillaume.
-
- *********************************************************************
- * Guillaume Cartier (514) 844-5294 (maison) *
- * L.A.C.I.M. (514) 987-4290 (bureau) *
- * Universite du Quebec a Montreal (514) 987-8477 (telecopieur) *
- * Montreal, Quebec, Canada cartier@math.uqam.ca (internet) *
- *********************************************************************
-