home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / object / 4615 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.0 KB  |  48 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!uchinews!alex!dave
  3. From: dave@alex.uchicago.edu (Dave Griffith)
  4. Subject: Re: Object hidden state and side effects
  5. Message-ID: <1992Dec21.151326.21426@midway.uchicago.edu>
  6. Sender: news@uchinews.uchicago.edu (News System)
  7. Organization: University of Chicago
  8. References: <1992Dec20.162050.14652@midway.uchicago.edu> <knight.724904387@cunews> <knight.724948496@cunews>
  9. Date: Mon, 21 Dec 1992 15:13:26 GMT
  10. Lines: 36
  11.  
  12. In article <knight.724948496@cunews> knight@mrco.carleton.ca (Alan Knight) writes:
  13. >In <knight.724904387@cunews> knight@mrco.carleton.ca (Alan Knight) writes:
  14. >
  15. >>In <1992Dec20.162050.14652@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
  16. >
  17. >>>>Normal storage (or mutable values): State can be modified, but there
  18. >>>>is no identity operation. e.g. storage allocated on the stack in
  19. >>>>traditional languages. 
  20. >
  21. >>>'Splain me, boss.  I'm feeling dumber than usual.
  22. >
  23. >Let me try that again more concisely, having rested my brain cells.
  24. >
  25. >Consider objects which are mutable but for which assignment is really
  26. >copying. An identity operation for such objects is meaningless because
  27. >no two can ever be identical. However, any individual object can be
  28. >modified. 
  29. >This is the normal case for data not represented by pointers in
  30. >traditional languages. 
  31. >
  32.  
  33. You're using assignment a lot differently then I have been.  When I think
  34. of assignment, I just mean binding values/objects to names.  There is no
  35. creation of new objects involved.  (Call this reference assignment.)
  36. Values, as I have been using the term, are immutable, and thus copying may
  37. be used as a possible optimization.  The actual semantics of assignment is
  38. still just binding values to names.  Variables aren't modified. Objects are
  39. modified, variables just get rebound, which results in the object containing
  40. them (if any) being modified.
  41.  
  42.  
  43.  
  44. -- 
  45. Dave Griffith, Information Resources, University of Chicago,
  46. Department of Surgery                       dave@alex.bsd.uchicago.edu
  47. A man's best friend is his dogma.
  48.