home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3075 comp.lang.eiffel:1028
- Newsgroups: comp.object,comp.lang.eiffel
- Path: sparky!uunet!psinntp!bony1!richieb
- From: richieb@bony1.bony.com (Richard Bielak)
- Subject: Re: Class methods (was: Re: How to design a data structure library)
- Message-ID: <1992Jul30.123951.20600@bony1.bony.com>
- Organization: multi-cellular
- References: <graham.712283419@galois> <1992Jul28.201820.27793@bony1.bony.com> <1992Jul29.140357.26748@merlin.hgc.edu>
- Date: Thu, 30 Jul 92 12:39:51 GMT
- Lines: 50
-
- In article <1992Jul29.140357.26748@merlin.hgc.edu> jcm@hgc.edu (James McKim) writes:
-
- [...]
-
- >
- >Yes, it's really the design of the _class_ that originally sparked
- >this discussion, not the syntax used. It does seem that designing
- >the standard set operations, string operations, etc as creation
- >routines is an idea worth pursuing.
- >
-
- Thanks for adding a voice of sanity into this discussion, before it
- degenerates into a flame war :-).
-
- My observation was this, although Eiffel does not have "class methods",
- as does SmallTalk, you can think of creation routines as class
- methods.
-
- During Object Expo I attended a talk by Meirl-Page Jones (sp?), in
- which he suggested that certain methods *should* be class methods (he
- was criticizing classes in Tim Budd's book "The Little SmallTalk").
-
- The example he used was "arccos" (ie. inverse cos function). He
- argued, that arccos, which returns "anAngle", should be a class method
- in class "Angle", rather than an instance method in class "Real".
-
- The reason was that he did not want to "encumber" the class "Real"
- with class "Angle", as the two are not always used together. Another
- words, making "arccos" a class method of "Angle" reduces class
- coupling.
-
- As another example, consider a routine, "string_to_real", which converts a
- string to real number. According to the above argument, this routine
- should be a creation routine in REAL. So you'd have code like this:
-
- !!pi.string_to_real ("3.14159");
-
- The twist in Eiffel is that you cannot use a creation instruction in
- an expression. But that's a different thread...
-
-
- ...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 - *
-