home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3020 comp.lang.eiffel:988
- Newsgroups: comp.object,comp.lang.eiffel
- Path: sparky!uunet!walter!geoff
- From: geoff@flash.bellcore.com (Geoffrey Clemm)
- Subject: Re: Class methods (was: Re: How to design a data structure library)
- In-Reply-To: mst@vexpert.dbai.tuwien.ac.at's message of 24 Jul 92 10:58:49 GMT
- Message-ID: <GEOFF.92Jul27100601@wodehouse.flash.bellcore.com>
- Sender: news@walter.bellcore.com
- Nntp-Posting-Host: wodehouse
- Organization: Bellcore
- References: <1992Jul23.123609.11699@bony1.bony.com> <5618@vexpert.dbai.tuwien.ac.at>
- Date: 27 Jul 92 10:06:01
- Lines: 43
-
- In article <5618@vexpert.dbai.tuwien.ac.at> mst@vexpert.dbai.tuwien.ac.at (Markus Stumptner) writes:
- > With explicit binary operators (as in C++ or Smalltalk),
- > you would write (if "+" expresses union)
-
- > c := a + b
-
- > That way, "+" is a message declared for sets, and used on sets. If
- > you want a named message, you would write
-
- > c := a.union(b)
-
- > (Still looks odd, but lacks that redundant third parameter)
-
- > > In Smalltalk lingo, "union" should be a "class method". The essence of
- > > a class method is that it can be invoked when the object of the given
- > > class does not exist yet.
-
- > Yes, but you already have two sets, a, and b, either of which you can
- > send the message to. Nobody decrees that the receiver of a message
- > has to be changed by it, therefore returning c is a valid way to do
- > it.
-
- I believe you missed the central point of Richie's article, namely that
- Eiffel 3.0 has a clean way of handling this situation, to quote:
-
- In article <1992Jul23.123609.11699@bony1.bony.com> richieb@bony1.bony.com (Richard Bielak) writes:
-
- > Given this, the above call to "union" would be written like this
- > (using Eiffel 3 syntax):
-
- > !!c.union (a,b);
-
- > Which I think is better.
-
- With which I completely agree. This avoids the unpleasant assymetry
- of c:=a.union(b).
-
- Cheers,
-
- Geoff
-
- --
- geoff@bellcore.com
-