home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / object / 4540 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  2.4 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!inews.Intel.COM!tcad05!bongalon
  2. From: bongalon@tcad05.intel.com (Ben Bongalon)
  3. Newsgroups: comp.object
  4. Subject: Re: Object hidden state and side effects
  5. Message-ID: <BzBC1L.3GJ@inews.Intel.COM>
  6. Date: 15 Dec 92 18:15:20 GMT
  7. References: <1992Dec11.163449.18439@crd.ge.com> <1992Dec13.152136.16852@hasler.ascom.ch> <1992Dec14.112222.13987@kei.is.s.u-tokyo.ac.jp> <1992Dec15.014420.6604@midway.uchicago.edu>
  8. Sender: news@inews.Intel.COM (USENET News System)
  9. Reply-To: bongalon@tcad05.intel.com (Ben Bongalon)
  10. Organization: Intel Corporation, Santa Clara, CA USA
  11. Lines: 40
  12. Nntp-Posting-Host: tcad05
  13.  
  14.  
  15. In article <1992Dec15.014420.6604@midway.uchicago.edu>,
  16. dave@alex.uchicago.edu (Dave Griffith) writes:
  17.  
  18. |> Actually, immutability is only a small part of being a value.  The important
  19. |> part is lack of identity.  All '3's are the same, regardless of their
  20. history.
  21. |> On the other hand, standard objects are only equal if they are identical.
  22. |> Immutability is necessary for values, but not sufficient.
  23.  
  24. Actually, it depends on how you look at it.  Are "all" 3's referring
  25. to several identical copies of that value or to one universally
  26. accessable value?  Not only is he latter a plausible answer but
  27. I believe it is a better model.
  28.  
  29. Frankly I don't understand all the confusion about the distinction
  30. between objects and values.  As i see it, an object may have internal states; 
  31. more specifically, an object may contain other objects, which 
  32. may in turn be composite (ie, contain other objects) or simple
  33. (ie, just contains values).  But note that simple and composite
  34. objects are merely concepts in our minds.  In order to apply them
  35. to computer programming, we map these objects into variables.
  36.  
  37. The primitive objects are the
  38. variables in a program that are defined with primitive data types
  39. (ie, int i, float x, char c    <--- i,x & c are primitive objects).
  40. Composite objects are the variables in a program that are outside
  41. the set of primitive objects.
  42.  
  43. An object can be ultimately decomposed into its primitive object 
  44. constituents, and these primitive objects get _values_ assigned to them.
  45. Thus, the disctinction between objects (variables) and values
  46. (literals) is clear.  Objects get values assigned to their data
  47. members.  Object X = Object Y  actually means that the values of
  48. the data members of Y get assigned to the corresponding data members
  49. of X.
  50.  
  51.  
  52. Ben Bongalon
  53. Intel Corporation
  54.