home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / object / 3044 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  2.0 KB

  1. Xref: sparky comp.object:3044 comp.lang.eiffel:1006
  2. Path: sparky!uunet!dtix!darwin.sura.net!mips!swrinde!cs.utexas.edu!sun-barr!ames!stanford.edu!rutgers!psinntp!psinntp!bony1!richieb
  3. From: richieb@bony1.bony.com (Richard Bielak)
  4. Newsgroups: comp.object,comp.lang.eiffel
  5. Subject: Re: Class methods (was: Re: How to design a data structure library)
  6. Message-ID: <1992Jul28.150114.25065@bony1.bony.com>
  7. Date: 28 Jul 92 15:01:14 GMT
  8. References: <GEOFF.92Jul27100601@wodehouse.flash.bellcore.com> <5631@vexpert.dbai.tuwien.ac.at>
  9. Organization: lost in Manhattan
  10. Lines: 35
  11.  
  12. In article <5631@vexpert.dbai.tuwien.ac.at> mst@vexpert.dbai.tuwien.ac.at (Markus Stumptner) writes:
  13.  
  14. [...]
  15.  
  16. >
  17. >I did get the point, I just don't like it.  I grant that the asymmetry
  18. >is avoided, but this is outwiehged by the fact that using the class
  19. >method is, in my opinion, a completely weird way of handling an
  20. >ordinary binary operator.  Sets are a bad example for that construct,
  21. >since they, as mathematical entities together with their appropriate
  22. >operators, should correspond fairly closely to, say, integers or
  23. >floats in this manner.  As an example, addition (which closely
  24. >corresponds to set union) is not a class message, and making it one
  25. >does not improve the clarity of the code.
  26. >
  27.  
  28.  
  29. Perhaps "+" _should_ be a class message. Again, "+" is not
  30. a "query" or a "command". For numbers, "absolute_value" or "sign" are
  31. examples of queries, and "increment" is a command. 
  32.  
  33. What is "+"? You could say it's a query, as it doesn't change the
  34. object, which asks "what is the sum of self and the argument".
  35.  
  36. But in math, a "+" is an operation on _integers_ (i.e. a class method)
  37. which given two integers, produces another one.
  38.  
  39.  
  40. ...richie
  41.  
  42. -- 
  43. * Richie Bielak   (212)-815-3072   | "Your brain is a liquid-cooled parallel  *
  44. * Internet:       richieb@bony.com | super-computer". He pointed to his nose, *
  45. * Bang {uupsi,uunet}!bony1!richieb | "This is the fan."                       *
  46. *    - Strictly my opinions -      |                     - David Chudnovsky - *
  47.