home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / object / 3013 < prev    next >
Encoding:
Text File  |  1992-07-27  |  3.3 KB  |  61 lines

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