home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!orstcs!fog.CS.ORST.EDU!budd
- From: budd@fog.CS.ORST.EDU (Tim Budd)
- Newsgroups: comp.object
- Subject: O.M() vs M(0) notation
- Message-ID: <1992Jul24.173655.5869@CS.ORST.EDU>
- Date: 24 Jul 92 17:36:55 GMT
- Article-I.D.: CS.1992Jul24.173655.5869
- Sender: usenet@CS.ORST.EDU
- Organization: Oregon State University, Computer Science Dept.
- Lines: 23
- Nntp-Posting-Host: fog.cs.orst.edu
-
- I agree that the O.M(...) notation clearly marks the receiver as special,
- and seems more natural to most folks.
-
- 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.
-
- 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.
-
- --tim budd, oregon state university
-