Re: Introducing new operators (was: Re: Scientists as Programmers)

kers@otter.hpl.hp.com (Chris Dollin)
Fri, 11 Sep 1992 13:57:23 GMT

          From comp.compilers

Related articles
Introducing new operators (was: Re: Scientists as Programmers) fjh@munta.cs.mu.OZ.AU (1992-09-08)
Re: Introducing new operators (was: Re: Scientists as Programmers) drw@euclid.mit.edu (1992-09-11)
Re: Introducing new operators (was: Re: Scientists as Programmers) kers@otter.hpl.hp.com (1992-09-11)
| List of all articles for this month |
Newsgroups: comp.compilers
From: kers@otter.hpl.hp.com (Chris Dollin)
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Date: Fri, 11 Sep 1992 13:57:23 GMT
Followup-To: comp.compilers
References: <1992Sep3.112944.20996@dbsun.uucp> 92-09-053
Keywords: C++, parse

In article ... fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:


    >> C++ allows you to overload existing operators, although to make compiler
    >> writer's jobs easier, it does not allow you to introduce new operators.
    >>
    >[argument whether it's nearly impossible, trivial, or somewhere between]


    I think that "next to impossible" is perhaps overstating the case a
    little. [...]


      All the same, it is not trivial. If you also have to worry about backwards
      compatability with C, it becomes very difficult indeed, I suspect.


And in my original message (the intro to which appears above), I did note that
compatability with C did present C++ language designers with a problem, viz,
preserving its lexis, if they wanted to have user-defined operators.


In a follow-up in comp.lang.misc, I have also noted that user-defined operator
(name) 's do not require user-define dprecedences, and that in fact I am happy
for the language to have a well-chosen *single* precedence for UDOs. This, I
submit, *does* make UDOs ``trivial'' to implement.


So long as they are designed in from the start, and not hacked on later.
--


Regards,
Kers.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.