home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pop / 225 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.5 KB

  1. Path: sparky!uunet!pipex!unipalm!uknet!cf-cm!scmdb
  2. From: David.Beasley@cm.cf.ac.uk (David Beasley)
  3. Newsgroups: comp.lang.pop
  4. Subject: Re: Re: dlocals etc. (and shallow binding)
  5. Message-ID: <1993Jan26.160320.27465@cm.cf.ac.uk>
  6. Date: 26 Jan 93 16:03:19 GMT
  7. References: <C1CAwq.8up@cs.bham.ac.uk> <116670051@otter.hpl.hp.com>
  8. Sender: news@cm.cf.ac.uk (Network News System)
  9. Organization: University of Wales College of Cardiff
  10. Lines: 24
  11.  
  12. In article <116670051@otter.hpl.hp.com> sfk@otter.hpl.hp.com (Steve Knight) writes:
  13. >If I write
  14. >    constant foo = {'dog'};
  15. >then the variable foo is immutable -- it always points to the same
  16. >location.  
  17.  
  18. Unless, of course there is a subsequent line such as:
  19.     constant foo = ['something else'];
  20.  
  21. Since you can easily redefine constants in this way, even these are mutable.
  22.  
  23. Using sysprotect("foo"); would provide an extra level of immutability,
  24. but even then that does not prevent a subsequent sysunprotect("foo");
  25. from making foo vulnerable again. I suppose ultimately, immutability 
  26. is a matter of degree, which depends on the amount of effort required
  27. to change the value to something else. The only totally unalterable 
  28. variables are those stored in ROM!
  29. --
  30.  
  31. David Beasley                          (David.Beasley@cm.cf.ac.uk)    
  32. Department of Computing Mathematics 
  33. University of Wales College of Cardiff                          __o
  34. PO Box 916                                                      \<,   
  35. CARDIFF    CF2 4YN                         ___________________()/ ()___  
  36.