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