home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / 2331 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  37 lines

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