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

  1. Xref: sparky comp.object:3049 comp.lang.eiffel:1010
  2. Path: sparky!uunet!email!vexpert.dbai.tuwien.ac.at!mst
  3. From: mst@vexpert.dbai.tuwien.ac.at (Markus Stumptner)
  4. Newsgroups: comp.object,comp.lang.eiffel
  5. Subject: Re: Class methods (was: Re: How to design a data structure library)
  6. Message-ID: <5642@vexpert.dbai.tuwien.ac.at>
  7. Date: 29 Jul 92 11:12:52 GMT
  8. References: <1992Jul28.150114.25065@bony1.bony.com>
  9. Organization: DB and ES Subdivision, TU Vienna
  10. Lines: 32
  11.  
  12. From article <1992Jul28.150114.25065@bony1.bony.com>, by richieb@bony1.bony.com (Richard Bielak):
  13. > But in math, a "+" is an operation on _integers_ (i.e. a class method)
  14.  
  15. Well, no.  Not at all.  "Operation on integers" means it is a function
  16. mapping pairs of integers to integers, i.e., it is applied to
  17. instances, no more, no less.  It is not reasonable to require that any
  18. message that returns an object different from the arguments (including
  19. receiver) be a class message.  In my opinion, what this mechanism does
  20. is mixing variable assignment and object generation together, which is
  21.  dirty hack if I've ever seen one.  Note that if you want to use your
  22. class-messages-with-target-variables inside expressions you'd have
  23. either
  24.  
  25. (1) you would have to introduce dummy variables to be able to use this
  26. kind of notation inside expressions (of course, unthinkable), or
  27.  
  28. (2) write, as one poster proposed, Set.union(a,b), effectively killing
  29. polymorphism by explicitly including the class in a message send that
  30. does very well without, or
  31.  
  32. (2) you'd have to introduce separate instance methods (like a union: b) 
  33. to do the same thing your class methods do, OR have the instance
  34. methods automatically generated whenever you define that kind of class
  35. method.  Now that kind of conceptual mixup in programs is not
  36. something I would like to have to maintain.
  37.  
  38. Entia non sunt multiplicanda praeter necessitatem.
  39.         -Occam
  40. -- 
  41. Markus Stumptner                                mst@vexpert.dbai.tuwien.ac.at
  42. University of Technology Vienna                 vexpert!mst@relay.eu.net
  43. Paniglg. 16, A-1040 Vienna, Austria             ...mcsun!vexpert!mst
  44.