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

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!bernina!neptune!santas
  3. From: santas@inf.ethz.ch (Philip)
  4. Subject: Re: Object hidden state and side effects
  5. Message-ID: <1992Dec23.011557.1495@neptune.inf.ethz.ch>
  6. Sender: news@neptune.inf.ethz.ch (Mr News)
  7. Nntp-Posting-Host: ru8.inf.ethz.ch
  8. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
  9. References: <knight.724904387@cunews> <knight.724948496@cunews> <1992Dec21.151326.21426@midway.uchicago.edu>
  10. Date: Wed, 23 Dec 1992 01:15:57 GMT
  11. Lines: 53
  12.  
  13.  
  14. In article <1992Dec21.151326.21426@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
  15. >
  16. >You're using assignment a lot differently then I have been.  When I think
  17. >of assignment, I just mean binding values/objects to names.  There is no
  18. >creation of new objects involved.  (Call this reference assignment.)
  19.  
  20. Example 1:
  21.  
  22. a := "asd"
  23. b := "qwe"
  24.  
  25. We have creation of new objects here. The strings
  26. "asd" and "qwe"  were _not_ preexisting.
  27.  
  28. Example 2:
  29.  
  30. c := "asd"
  31.  
  32. Do you use the same "asd" as before?
  33. (as far as I remember, you imposed _not_ to)
  34.  
  35. >Values, as I have been using the term, are immutable, and thus copying may
  36. >be used as a possible optimization.  
  37.  
  38. Usually _not_-copying is an optimization.
  39. If something is _definitely _immutable_, why should one need to _copy_ it?
  40.  
  41. >                                     The actual semantics of assignment is
  42. >still just binding values to names.  Variables aren't modified. Objects are
  43. >modified, variables just get rebound, which results in the object containing
  44. >them (if any) being modified.
  45.  
  46. This is very confusing.
  47. In the examples above, which are the objects, which are the values
  48. and which are the variables?
  49. (for help, add the operation: 
  50.    c.appendToSelf: "f"
  51.  and please, explain what happens during this operation, while
  52.  distinguising between objects/variables/values)
  53.  
  54. Philip Santas
  55.  
  56.   "In an evolving universe those who stand still are really moving backwards"
  57. --------------------------------------------------------------------------------
  58. email: santas@inf.ethz.ch                 Philip Santas
  59. Mail: Dept. Informatik                   Inst. of Scientific Computation
  60.       ETH-Zentrum              Swiss Federal Institute of Technology
  61.       CH-8092 Zurich                       Zurich, Switzerland
  62.       Switzerland
  63. Phone: +41-1-2547478
  64.       
  65.  
  66.