home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!spool.mu.edu!sdd.hp.com!saimiri.primate.wisc.edu!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!rz.uni-karlsruhe.de!ma2s2!haible
- From: haible@ma2s2.uucp (Bruno Haible)
- Newsgroups: comp.lang.lisp
- Subject: Re: eval-when situation question
- Date: 16 Dec 1992 16:28:59 GMT
- Organization: University of Karlsruhe, Germany
- Lines: 41
- Sender: <haible@ma2s2.mathematik.uni-karlsruhe.de>
- Message-ID: <1gnlgbINN6bs@nz12.rz.uni-karlsruhe.de>
- References: <1992Dec15.190606.102345@eratu.rz.uni-konstanz.de>
- NNTP-Posting-Host: ma2s2.mathematik.uni-karlsruhe.de
- Keywords: eval-when, *readtable*
-
- Hi,
-
- Joerg asks:
- > I've got a file that makes use of a modified *readtable* provided by
- > an other file, and I'd like the environment (say *readtable*) not
- > altered by the loading (or even compilation) of that file.
-
- Use
-
- (eval-when (compile eval)
- (shiftf *original-readtable* *readtable* *special-readtable*)
- )
-
- at the beginning and
-
- (eval-when (compile eval)
- (setq *readtable* *original-readtable*)
- )
-
- at the end of that file.
-
- > Ideally, the reader would expand the ? at read-time, so that the compiler
- > wouldn't even see the ?. I believe that the (eval-when (compile) #)
- > takes care of this.
-
- Exactly that is happening.
-
- The "eval" situation accounts for the case where the uncompiled .lisp file
- is loaded. The "load" situation is not needed here since it denotes loading
- of the compiled .fasl file which of course does not contain the ? any more.
-
- > But I'm wondering why CLtLII, p.89 provides a similar example with
- > set-macro-character and says to use (eval-when (compile load eval) #),
- > not only (compile) as the set of situations.
-
- Because it is usual to modify the environment, for example to test the
- read macro.
-
- Bruno
- haible@ma2s2.mathematik.uni-karlsruhe.de
-
-