From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 24 Jun 93 20:18:06 GMT From: cis.ohio-state.edu!news.sei.cmu.edu!jbg@ucbvax.Berkeley.EDU (John Gooden ough) Subject: Re: Precedence Rules (was Re: Software vendors not using Ada but C) Message-ID: <1993Jun24.161806.333@sei.cmu.edu> List-Id: 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