home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!rp23+@andrew.cmu.edu
- From: rp23+@andrew.cmu.edu (Ray Pelletier)
- Newsgroups: comp.lang.lisp.mcl
- Subject: Re: Making a lambda-expr more like a fn
- Message-ID: <If2aVF200WA1A1pQdJ@andrew.cmu.edu>
- Date: 18 Nov 92 15:59:13 GMT
- References: <9211160703.AA22159@gremlin>
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 26
- 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?
-
- --Ray Pelletier
-