home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!cs.utexas.edu!rutgers!faatcrl!iecc!compilers-sender
- From: kers@otter.hpl.hp.com (Chris Dollin)
- Newsgroups: comp.compilers
- Subject: Re: Introducing new operators (was: Re: Scientists as Programmers)
- Keywords: C++, parse
- Message-ID: <92-09-067@comp.compilers>
- Date: 11 Sep 92 13:57:23 GMT
- References: <1992Sep3.112944.20996@dbsun.uucp> <92-09-053@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: kers@otter.hpl.hp.com (Chris Dollin)
- Followup-To: comp.compilers
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Lines: 30
- Approved: compilers@iecc.cambridge.ma.us
-
- 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.
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-