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

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!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.005532.1237@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: <BzIFGp.K7@cs.uiuc.edu> <1992Dec20.155809.14236@midway.uchicago.edu> <BzKv4J.3Lt@cs.uiuc.edu>
  10. Date: Wed, 23 Dec 1992 00:55:32 GMT
  11. Lines: 42
  12.  
  13. In article <BzKv4J.3Lt@cs.uiuc.edu> johnson@cs.uiuc.edu (Ralph Johnson) writes:
  14. >
  15. > Probably you can enforce
  16. >reflexivity by stating that an object is equal with itself whenever you
  17. >create a new object.  
  18.  
  19. I'm not sure you can do this if you use pointers:
  20. If you define equality as equality of the adresses of _objects_,
  21. then 
  22.  
  23. x == (x.increment)
  24.  
  25. might give you True :-(
  26.  
  27. >I don't have any idea about transitivity, nor about
  28. >substitutability of equals for equals.
  29.  
  30. You cannot do this safely in an environment with side effects,
  31. since we have the same case as above.
  32.  
  33. >If it turns out that there is a way to express that in Eiffel, how about
  34. >my example of requiring that a function used by a sorter provide
  35. >a total ordering on the collection to be sorted.  I guess you could
  36. >do this for any particular finite collection by checking all triples.
  37.  
  38. But you cannot always provide a total ordering. You cannot even provide
  39. a partial ordering: you can write the identity function in infinity
  40. number of ways; can you provide an algorithm that orders a collection
  41. of functions?
  42.  
  43. Philip Santas
  44.  
  45.   "In an evolving universe those who stand still are really moving backwards"
  46. --------------------------------------------------------------------------------
  47. email: santas@inf.ethz.ch                 Philip Santas
  48. Mail: Dept. Informatik                   Inst. of Scientific Computation
  49.       ETH-Zentrum              Swiss Federal Institute of Technology
  50.       CH-8092 Zurich                       Zurich, Switzerland
  51.       Switzerland
  52. Phone: +41-1-2547478
  53.       
  54.  
  55.