home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!edcastle!aiai!jeff
- From: jeff@aiai.ed.ac.uk (Jeff Dalton)
- Newsgroups: comp.lang.lisp
- Subject: Re: Freezing a variable: how?
- Message-ID: <7417@skye.ed.ac.uk>
- Date: 1 Sep 92 15:27:21 GMT
- References: <1992Aug28.194300.20461@jpl-devvax.jpl.nasa.gov> <19920829213038.4.KMP@PLANTAIN.SCRC.Symbolics.COM>
- Sender: news@aiai.ed.ac.uk
- Organization: AIAI, University of Edinburgh, Scotland
- Lines: 17
-
- For global variables, you could write your own macro to use instead of
- SETQ and have the expansion check. Eg:
-
- (defmacro safe-setq (var form)
- `(if (get ',var 'constant)
- (error ...)
- (setq ,var ,form)))
-
- and then
-
- (defun make-constant (var)
- (setf (get var 'constant) t))
-
- -- jd
-
-
-
-