home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!john!jubo
- From: jubo@john.informatik.rwth-aachen.de (Juergen Boerstler)
- Subject: Re: O.M() vs M(0) notation
- Message-ID: <jubo.712224166@rwthi3>
- Sender: news@Urmel.Informatik.RWTH-Aachen.DE (Newsfiles Owner)
- Nntp-Posting-Host: john
- Organization: Rechnerbetrieb Informatik / RWTH Aachen
- References: <1992Jul24.173655.5869@CS.ORST.EDU>
- Date: 27 Jul 92 08:02:46 GMT
- Lines: 48
-
- budd@fog.CS.ORST.EDU (Tim Budd) writes:
-
- >I agree that the O.M(...) notation clearly marks the receiver as special,
- >and seems more natural to most folks.
-
- And its also more practical for several reasons:
- Using the `M(O)' notation you will have problems in defining inheritance,
- since all your `O' parameters will still be of type O-type instead of
- subtype(O)-type in all of your subclasses. So its better to omit this
- special parameter.
- >In our multiparadigm language LEDA (which has nothing to do with the C++
- >classes of the same name distributed by somebody in Germany), we wanted
- >to combine features of object oriented programming and functional
- >programming. Part of this is the desire to permit methods to be
- >used as functions - that is, passed as arguments to higher level functions,
- >and so on. Our solution was to permit easy (implicit) convertion between
- >the ``method'' type and the ``function'' type - when a qualified method
- >name is used in a context where a function is required (say, as an
- >argument), it is magically converted into a function, including adding
- >an argument to the front of the argument list. Thereafter it is
- >invoked using the functional M(O) notation.
- So why don't you define a special class `function' for this purpose. This
- class should contain methods to convert itself to both representations.
- >For the sake of symmetry we also allowed the reverse. If you defined
- >a function that used an object as the first argument, you could invoke
- >it using the O.M() notation -- if the complier could not find a method
- >of a given name it would then look for an appropriate function. This has
- >not provem to be quite as useful, and I am not sure it will remain in the
- >language.
- This will be fine too, using a special `function'-class. Then conversion
- should only be done explicitely, which is much better to read.
- >--tim budd, oregon state university
-
- jubo
- ****************************************************************************
- * Ju"rgen Bo"rstler * e-mail: *
- * RWTH Aachen * jubo@rwthi3.informatik.rwth-aachen.de *
- * Lehrstuhl fuer Informatik III * *
- * Ahornstrasse 55 * *
- * W-5100 Aachen * phone: +49/ 241/ 80-21310 *
- * Germany * fax: -21329 *
- ****************************************************************************
-
- --
- ****************************************************************************
- * Ju"rgen Bo"rstler * e-mail: *
- * RWTH Aachen * jubo@rwthi3.informatik.rwth-aachen.de *
- * Lehrstuhl fuer Informatik III * *
-