comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
To: "whiting_ms@corning.com (Matt Whiting)" <whiting_ms@corning.com>
Subject: Re: GNAT messages and the not operator (pitfall alert!)
Date: 1996/10/30
Date: 1996-10-30T00:00:00+00:00	[thread overview]
Message-ID: <32778241.44CC@watson.ibm.com> (raw)
In-Reply-To: 1996Oct30.073739.1@corning.com


whiting_ms@corning.com (Matt Whiting) wrote:

> Yes, that is clear (and has been!), but the table on p. 246 of Ada as a Second
> Language (2nd Edition), doesn't have parens around the first argument!
> 
> When I see X mod 4 and then see the column header have -5, I read that as
> -5 mod 4, not as (-5) mod 4.  I think the table could be more clear...  :-)
> Had the table read (X) mod 4...

By this reasoning, one would expect "A*4 where A=2+3" to mean "2+3*4".

I expect it to be clear to all readers that X in Figure 6.2 represents
an integer value, not a string to be macro-substituted into the string
"X mod 4" to yield the string 
"-5 mod 4".  Rather, the table entry corresponding to the row labeled "X
mod 4" and the column labeled with -5 for the value of X gives the value
that would be written by the statements

   X := -5;
   Put ( X mod 4 );

The caption begins with the words, "Illustrations of the behavior of rem
and mod ...," which ought to make it clear that the focus of the table
is on run-time computations performed on particular values rather than
on syntactic issues like precedence level in the text of the program. 
Indeed, the caption specifically refers to successive "values" of X.

If Matt thinks that (X) conveys anything different from X, perhaps he
has spent too much time working with a C preprocessor. :-)

However, if other readers have misinterpreted the table in the same way
that Matt did, I would certainly like to hear about it!  (Private e-mail
will do, no need to clutter the newsgroup.)

-- 
Norman H. Cohen
mailto:ncohen@watson.ibm.com
http://www.research.ibm.com/people/n/ncohen




  reply	other threads:[~1996-10-30  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-24  0:00 GNAT messages and the not operator (pitfall alert!) Robert Dewar
1996-10-24  0:00 ` Robert Dewar
1996-10-25  0:00   ` whiting_ms@corning.com (Matt Whiting)
1996-10-26  0:00     ` David C. Hoos, Sr.
1996-10-27  0:00     ` Robert Dewar
1996-10-28  0:00       ` Matthew S. Whiting
1996-10-26  0:00   ` John Herro
1996-10-26  0:00     ` Matthew Heaney
1996-10-29  0:00       ` Robert Dewar
1996-10-26  0:00     ` Robert Dewar
1996-10-29  0:00       ` John Herro
1996-10-29  0:00         ` Robert Dewar
1996-10-30  0:00     ` Dr. Peter E. Obermayer
1996-10-30  0:00       ` John Herro
1996-10-30  0:00         ` Robert Dewar
1996-11-01  0:00         ` User Password expiration date extractor? Stein-Aksel Basma
1996-10-29  0:00   ` GNAT messages and the not operator (pitfall alert!) Norman H. Cohen
1996-10-29  0:00     ` whiting_ms@corning.com (Matt Whiting)
1996-10-30  0:00       ` David C. Hoos, Sr.
1996-10-30  0:00         ` whiting_ms@corning.com (Matt Whiting)
1996-10-30  0:00           ` Norman H. Cohen [this message]
1996-10-30  0:00       ` Norman H. Cohen
1996-11-06  0:00         ` Richard A. O'Keefe
1996-11-18  0:00           ` Norman H. Cohen
1996-11-18  0:00             ` Robert Dewar
1996-10-30  0:00       ` Robert Dewar
1996-11-05  0:00     ` Robert Dewar
1996-10-28  0:00 ` Cary Jamison
1996-10-29  0:00   ` Robert Dewar
replies disabled

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