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

  1. Path: sparky!uunet!olivea!pagesat!spssig.spss.com!uchinews!alex!dave
  2. From: dave@alex.uchicago.edu (Dave Griffith)
  3. Newsgroups: comp.object
  4. Subject: Re: Object hidden state and side effects
  5. Message-ID: <1992Dec15.201242.8995@midway.uchicago.edu>
  6. Date: 15 Dec 92 20:12:42 GMT
  7. References: <1992Dec14.112222.13987@kei.is.s.u-tokyo.ac.jp> <1992Dec15.014420.6604@midway.uchicago.edu> <BzBC1L.3GJ@inews.Intel.COM>
  8. Sender: news@uchinews.uchicago.edu (News System)
  9. Organization: University of Chicago
  10. Lines: 67
  11.  
  12. In article <BzBC1L.3GJ@inews.Intel.COM> bongalon@tcad05.intel.com (Ben Bongalon) writes:
  13. >
  14. >In article <1992Dec15.014420.6604@midway.uchicago.edu>,
  15. >dave@alex.uchicago.edu (Dave Griffith) writes:
  16. >
  17. >|> Actually, immutability is only a small part of being a value.  The important
  18. >|> part is lack of identity.  All '3's are the same, regardless of their
  19. >history.
  20. >|> On the other hand, standard objects are only equal if they are identical.
  21. >|> Immutability is necessary for values, but not sufficient.
  22. >
  23. >Actually, it depends on how you look at it.  Are "all" 3's referring
  24. >to several identical copies of that value or to one universally
  25. >accessable value?  Not only is he latter a plausible answer but
  26. >I believe it is a better model.
  27. >
  28.  
  29. No problems here.
  30.  
  31. >Frankly I don't understand all the confusion about the distinction
  32. >between objects and values.  As i see it, an object may have internal states; 
  33. >more specifically, an object may contain other objects, which 
  34. >may in turn be composite (ie, contain other objects) or simple
  35. >(ie, just contains values).  But note that simple and composite
  36. >objects are merely concepts in our minds.  In order to apply them
  37. >to computer programming, we map these objects into variables.
  38. >
  39.  
  40. The distinction between simple and compound is somewhat useful, but has
  41. very little to do with the value/object distinction.  One may have simple
  42. objects, with identity but with no internal state.  An example would be 
  43. capability tokens in operating system theory.  Atomic and immutable,
  44. but also uncopyable, so that equality and assignment must be based on 
  45. identity.  OTOH, If we wish to have user defined values, compound values 
  46. certainly make sense.  Complex numbers (a compound of two real values),
  47. and immutable strings (compound of some number of characters) leap to mind.
  48.  
  49. >The primitive objects are the
  50. >variables in a program that are defined with primitive data types
  51. >(ie, int i, float x, char c    <--- i,x & c are primitive objects).
  52. >Composite objects are the variables in a program that are outside
  53. >the set of primitive objects.
  54. >
  55. >An object can be ultimately decomposed into its primitive object 
  56. >constituents, and these primitive objects get _values_ assigned to them.
  57.  
  58. Far too limited and inflexible, as shown above.
  59.  
  60. >Thus, the disctinction between objects (variables) and values
  61. >(literals) is clear.  Objects get values assigned to their data
  62. >members.  Object X = Object Y  actually means that the values of
  63. >the data members of Y get assigned to the corresponding data members
  64. >of X.
  65. >
  66.  
  67. Intriguing.  It seems as though your defining an object as something which
  68. has aliasing semantics for assignment.  It is certainly the case, but it
  69. seems a rather process-oriented and rarified starting point for defining 
  70. object orientation.  As though you were starting a discussion of lambda 
  71. calculus with formal reduction rules, without ever mentioning that your
  72. formalism was meant to model something higher-level (mathematical functions).
  73.  
  74.  
  75. -- 
  76. Dave Griffith, Information Resources, University of Chicago,
  77. Department of Surgery                       dave@alex.bsd.uchicago.edu
  78. Oh, by the way, I almost forgot.  Godot called.  He said he'd be late.
  79.