From -2221940628816034198
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9a6b7da9ba54eaea
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1993-07-05 12:20:59 PST
Newsgroups: comp.std.c++
Path: gmd.de!xlink.net!howland.reston.ans.net!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp95.csrd.uiuc.edu!schouten
From: schouten@sp95.csrd.uiuc.edu (Dale Schouten)
Subject: Re: C++ Language Extensions
In-Reply-To: ark@alice.att.com's message of 5 Jul 93 16:09:41 GMT
Message-ID: <SCHOUTEN.93Jul5141810@sp95.csrd.uiuc.edu>
Sender: news@csrd.uiuc.edu
Reply-To: schouten@sp95.csrd.uiuc.edu
Organization: Center for Supercomputing R & D
References: <C9Js78.E7F@jabba.ess.harris.com> <212tii$5nb@senator-bedfellow.MIT.EDU>
	<rfgC9KttA.AKq@netcom.com> <215t2r$sv4@senator-bedfellow.MIT.EDU>
	<25936@alice.att.com>
Date: 05 Jul 1993 19:18:10 GMT
Lines: 31

In article <25936@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:

>> Exponentiation is a very small addition to a compiler.
>
>I wish that were true.  It is a very small addition to a parser, but
>there is a *lot* of other work to do.

[Lots of examples about round-off and equivalence semantics deleted]

I don't see how this is relevant.  All we (proponents of
an exponentiation operator) are asking for is a character or two
to be defined as a right-associative high priority operator.  Forget
about semantics.  I would think this kind of flexibility would
be quite useful.  Mathematicians use such things all the time for
the expression of various different functions.  I don't see why
this is such a complex thing to do.

>Finally, one might argue that x~2 should be equivalent to x*x even
>if x is of user-defined type -- so long as x*x is well-defined and
>~ isn't explicitly overridden.
That's silly.  You might as well get rid of * because one might
argue that x*2 must equal x+x even for user defined types!  Same goes
for all this discussion of numerical issues; replace * with + and
~ with * and you have the same problem.

If it bothers everyone so much, forget about exponentiation, I just
want a right associative binary operator with precedence higher than / & *.
What's wrong with that?

Dale Schouten
schouten@uiuc.edu


