comp.lang.ada
 help / color / mirror / Atom feed
From: cis.ohio-state.edu!news.sei.cmu.edu!jbg@ucbvax.Berkeley.EDU  (John Gooden
Subject: Re: Precedence Rules (was Re: Software vendors not using Ada but C)
Date: 24 Jun 93 20:18:06 GMT	[thread overview]
Message-ID: <1993Jun24.161806.333@sei.cmu.edu> (raw)

In article <20cajmINNqeb@umbc4.umbc.edu>, berman@umbc.edu (Mike Berman) writes:

|> So what's the real story-behind-the-story? Is it just easier to set up
|> the precedence rules this way [i.e., with mod and rem the same precedence
|> as for / and therefore of higher precedence than unary minus], or is there
|> some neat anecdote associated with mod and rem?

The problem is really with the precedence of unary minus.  Some languages make
all unary operators the highest precedence.  Ada doesn't in part because Jean
didn't want too many levels of precedence -- he felt strongly that languages
with many precedence levels were too complicated (I think this was in part a
reaction against ALGOL 68).  The design team also rejected a proposal to place
all unary operators at a higher level of precedence.  During the design, Ron
Brender (and others) suggested that unary + and - be placed with abs at the
highest precedence level.  The design team rejected the proposal (in comment
#5289), saying:

	It is important to be able to say

		-abs X

	Hence the need to have unary adding on a different level [than abs].

Implicit in this decision is a decision not to create an additional higher
precedence level (in the syntax) for unary + and - operators; this is where
the designer's concern for minimizing the numbers of levels of precedence also
affected the final decision (in my opinion).

John B. Goodenough					Goodenough@sei.cmu.edu
Software Engineering Institute				412-268-6391

             reply	other threads:[~1993-06-24 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-24 20:18 cis.ohio-state.edu!news.sei.cmu.edu!jbg [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-06-29  4:06 Precedence Rules (was Re: Software vendors not using Ada but C) Michael Feldman
1993-06-29  3:23 cis.ohio-state.edu!math.ohio-state.edu!sdd.hp.com!network.ucsd.edu!munnar
1993-06-25 20:50 Michael Feldman
1993-06-25 15:09 Jonathan Schilling
1993-06-24 15:22 magnesium.club.cc.cmu.edu!news.sei.cmu.edu!ae
1993-06-24 13:35 agate!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!news.umbc.edu!
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox