home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp
- Path: sparky!uunet!elroy.jpl.nasa.gov!ufo!Aig.Jpl.Nasa.Gov!charest
- From: charest@Aig.Jpl.Nasa.Gov (Len Charest)
- Subject: Re: Freezing a variable: how?
- Message-ID: <1992Aug28.194300.20461@jpl-devvax.jpl.nasa.gov>
- Followup-To: comp.lang.lisp
- Keywords: Freezing variables: Declaring as constant from here on after:
- Sender: usenet@jpl-devvax.jpl.nasa.gov (For NNTP so rrn will be able to post)
- Nntp-Posting-Host: ai-cyclops
- Reply-To: charest@aig.jpl.nasa.gov
- Organization: NASA/Jet Propulsion Laboratory
- References: <1992Aug28.155335.12562@cs.cornell.edu>
- Date: Fri, 28 Aug 1992 19:43:00 GMT
- Lines: 21
-
- In article <1992Aug28.155335.12562@cs.cornell.edu>, raman@cs.cornell.edu (T. V. Raman) writes:
- |>
- |> In common lisp Lucid 4.1 I would like to have the following:
- |>
- |> After an initial setup phase, I would like to declare a variable as
- |> being unmodifiable. ... Is there a standard way of doing this?
-
- I don't think so. I think you're stuck doing your own variable access
- management. However, it would be relatively easy to 'localize' this
- access management if you were willing to access the variables through a
- standard form (e.g,. SLOT-VALUE, READERS in CLOS) rather than as
- regular symbols. In fact, if you did use CLOS, you could store the
- varibles as class slots that initially have both a READER and a WRITER.
- After the setup phase was complete you could use the MOP to remove all
- of the WRITER methods. (For completeness, you'd probably also want to
- override the default method on SLOT-VALUE-USING-CLASS such that it
- signalled an error.)
- ..................................................
- Len Charest, Jr.
- JPL Artificial Intelligence Group
- charest@aig.jpl.nasa.gov
-