home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / compiler / 1548 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  1.9 KB

  1. Path: sparky!uunet!usc!cs.utexas.edu!rutgers!faatcrl!iecc!compilers-sender
  2. From: kers@otter.hpl.hp.com (Chris Dollin)
  3. Newsgroups: comp.compilers
  4. Subject: Re: Introducing new operators (was: Re: Scientists as Programmers)
  5. Keywords: C++, parse
  6. Message-ID: <92-09-067@comp.compilers>
  7. Date: 11 Sep 92 13:57:23 GMT
  8. References: <1992Sep3.112944.20996@dbsun.uucp> <92-09-053@comp.compilers>
  9. Sender: compilers-sender@iecc.cambridge.ma.us
  10. Reply-To: kers@otter.hpl.hp.com (Chris Dollin)
  11. Followup-To: comp.compilers
  12. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  13. Lines: 30
  14. Approved: compilers@iecc.cambridge.ma.us
  15.  
  16. In article ... fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  17.  
  18.   >>  C++ allows you to overload existing operators, although to make compiler
  19.   >>  writer's jobs easier, it does not allow you to introduce new operators.
  20.   >>
  21.   >[argument whether it's nearly impossible, trivial, or somewhere between]
  22.  
  23.   I think that "next to impossible" is perhaps overstating the case a
  24.   little.  [...]
  25.  
  26.    All the same, it is not trivial. If you also have to worry about backwards
  27.    compatability with C, it becomes very difficult indeed, I suspect.
  28.  
  29. And in my original message (the intro to which appears above), I did note that
  30. compatability with C did present C++ language designers with a problem, viz,
  31. preserving its lexis, if they wanted to have user-defined operators.
  32.  
  33. In a follow-up in comp.lang.misc, I have also noted that user-defined operator
  34. (name) 's do not require user-define dprecedences, and that in fact I am happy
  35. for the language to have a well-chosen *single* precedence for UDOs. This, I
  36. submit, *does* make UDOs ``trivial'' to implement.
  37.  
  38. So long as they are designed in from the start, and not hacked on later.
  39. --
  40.  
  41. Regards,
  42. Kers.
  43. -- 
  44. Send compilers articles to compilers@iecc.cambridge.ma.us or
  45. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  46.