home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / object / 4547 < prev    next >
Encoding:
Text File  |  1992-12-15  |  4.0 KB  |  83 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!usc!rpi!uwm.edu!cs.utexas.edu!torn!nott!cunews!cunews!knight
  3. From: knight@mrco.carleton.ca (Alan Knight)
  4. Subject: Re: Object hidden state and side effects
  5. Message-ID: <knight.724477055@cunews>
  6. Sender: news@cunews.carleton.ca (News Administrator)
  7. Reply-To: knight@mrco.carleton.ca (Alan Knight)
  8. Organization: Carleton University
  9. References: <knight.723766977@cunews> <1992Dec8.072805.10442@jyu.fi> <Byxv7s.AH6@cs.uiuc.edu> <1992Dec9.114035.26542@ruby.comlab.ox.ac.uk> <knight.724021213@cunews> <1992Dec11.163449.18439@crd.ge.com>
  10. Date: Wed, 16 Dec 1992 03:37:35 GMT
  11. Lines: 72
  12.  
  13. In <1992Dec11.163449.18439@crd.ge.com> eaker@ukulele.crd.ge.com (Chuck Eaker) writes:
  14.  
  15. >In article <knight.724021213@cunews>, knight@mrco.carleton.ca (Alan Knight) writes:
  16.  
  17. >|> In Smalltalk one cannot delete an object of any kind. One can,
  18. >|> however, create numbers perfectly well. 
  19. >|>   Fraction numerator: 3 denominator: 4 
  20. >|> 
  21. >|> is perfectly valid Smalltalk code which creates a new fraction with
  22. >|> value 3/4. Why is that crazy?
  23.  
  24. >It's crazy because it is not an example of creating a value. The
  25. >value 3/4 has been around a long time. What this example creates
  26. >is yet another digital representation of that value.
  27.  
  28. >It is more accurate to say that you have created space, and in
  29. >that space will be placed a bit pattern which represents a value. 
  30. >But even that is a fiction. What is really created is not space
  31. >but a way to refer to a space which can hold only one of many
  32. >things each of which is taken to represent a value or even a range
  33. >of values.
  34.  
  35. We can never have the value itself, whether in software or in
  36. discourse. All we can do is have symbols that represent a value in
  37. some way. In mathematics we give things names. The written 3/4 here on
  38. your screen is no different from a bit pattern in the computer, and if
  39. I say Let i=3/4 it doesn't matter if I mean it mathematically or as a
  40. statement in a computer program.
  41.  
  42. >In short, software must use objects to represent values. This is
  43. >why the distinction between values and objects is of enormous
  44. >importance. Software objects are used to model real world objects
  45. >as well as real world values. Modeling objects with other objects
  46. >is far more straight-forward than modeling values with objects.
  47. >The field of numerical analysis is all about the difficulties
  48. >which arise when one is forced to use objects to represent values.
  49.  
  50. There are no "real-world values", and I personally find it ridiculous
  51. to attempt to identify "objects" in the OO sense with things that can
  52. be picked up and thrown. (I wrote an article which is at least partly
  53. about this in the September 1992 Smalltalk Report). 
  54.  
  55. This discussion gets very philosophical.  Personally, I think that we
  56. know the set of all marriages in pretty much the same way we know the
  57. set of all reals or the set of all true theorems. I'm not, however,
  58. prepared to do the homework required to debate the issue in full.
  59. Perhaps a crossposting to alt.philosophy.endless.debates is in order.
  60.  
  61. The original question to which I responded was how it was possible to
  62. have a functional OO language. Those who believe that the fundamental
  63. characteristics of an object are modifiable state and a distinct
  64. identity obviously will not believe it is possible.
  65.  
  66. On the other hand, if you make a functional language which has
  67. classes, inheritance, polymorphism, encapsulation and dynamic binding,
  68. but not mutable state for instances, I would say you have a functional
  69. OO language (with great acronym potential).  I thought Ralph Johnson
  70. summed it up with his lengthy posting early on in the debate on why he
  71. did not feel it worthwhile to make the distinction.
  72.  
  73. I should also add that numerical analysis is not about modelling
  74. values with objects, it is about using approximations to represent
  75. quantities. Approximations are just as much values as the things they
  76. approximate. 
  77.  
  78. -- 
  79.  Alan Knight  knight@mrco.carleton.ca  +1 613 788 2600x1027 
  80.  Dept. of Mechanical and Aerospace Engineering              
  81.  Carleton University, Ottawa, Ontario, Canada, K1S 5B6      
  82.  
  83.