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