home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / misc / 3793 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  1.8 KB

  1. Path: sparky!uunet!pipex!warwick!uknet!glasgow!unix.brighton.ac.uk!je
  2. From: je@unix.brighton.ac.uk (John English)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <1992Nov19.122018.22959@unix.brighton.ac.uk>
  6. Date: 19 Nov 92 12:20:18 GMT
  7. References: <Bxnupn.E27@mentor.cc.purdue.edu>
  8. Organization: University of Brighton, UK
  9. Lines: 24
  10.  
  11. hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  12. : In article <1992Nov13.073809.11835@arb-phys.uni-dortmund.de> wb@arb-phys.uni-dortmund.de (Wilhelm B. Kloke) writes:
  13. : >In article <BxLxqu.96C@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  14. : >You need a (possibly implicitly constructed) structure to make
  15. : >this sort of assignment possible. Defining an unary operator which
  16. : >returns a struct is possible at least in C++ and Algol68.
  17. : I believe it is possible in Algol68, but it is not possible in C++.
  18. : C++ does not allow the introduction of new operator symbols; only new
  19. : functions.
  20.  
  21. Sorry, wrong -- C++ allows existing unary operators to be overloaded
  22. provided the operand is a class object (the operator is defined as a
  23. member function of the class). It can then return anything you want
  24. it to.  New operator SYMBOLS are indeed not allowed (none of that
  25. Algol 68 fun with MONADs, NOMADs and DYADs (what, no DRYADs? :-)
  26. -- 
  27. -------------------------------------------------------------------------------
  28. John English            | "Yes, understanding today's complex world of
  29. Dept. of Computing        |  the future IS a little like having bees live
  30. University of Brighton        |  in your head... but, there they are..."
  31. Janet: je @ unix.brighton.ac.uk    | "People who live in windowed environments
  32. Fax:   0273 642405        |  shouldn't cast pointers"
  33. -------------------------------------------------------------------------------
  34.