comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: In Exception ?
Date: 1998/04/07
Date: 1998-04-07T00:00:00+00:00	[thread overview]
Message-ID: <1998040713020801.JAA18110@ladder01.news.aol.com> (raw)
In-Reply-To: 6g660e$khm$1@news.mhv.net


pvanbell@mhv.net wrote:
> Or else use an enumeration variable that is
> set to either EXCEPTION or NORMAL: ...
> Type Calling_Source_Type is (Exception, Normal);

I bet it won't compile!  For the same reason that none of these will compile:

type Direction is (Forward, Reverse, Left, Right);
type Tape_Command is (Play, Record, Stop, Fast_Forward, Rewind, Pause);
type Chemical Element is (H, He, Li, Be, ...); -- Fails at Indium.
type State is (AL, AK, AZ, AR, ...); -- Fails at Indiana and Oregon.

Those darn reserved words bite you when you least expect it!  On the other
hand, I once saw a Fortran program that used IF for a variable name!  (Fortran
has keywords but no reserved words.)  To make readability even worse, although
the variable name implies integer, the variable was actually floating point! 
(It was the Intermediate Frequency in a radio.)  I guess Ada's reserved words
aren't so bad after all!

In any event, the advice given is fine; just make a slight change to the
spelling of "Exception."

- John Herro
Download the shareware AdaTutor program at
http://members.aol.com/AdaTutor




  reply	other threads:[~1998-04-07  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35214b7a.0@news.profinet.at>
1998-04-04  0:00 ` In Exception ? Paul Van Bellinghen
1998-04-07  0:00   ` John Herro [this message]
1998-04-05  0:00 ` Corey Ashford
1998-04-07  0:00   ` nabbasi
1998-04-07  0:00     ` Corey Minyard
     [not found]     ` <Er1n22.24v@world.std.com>
1998-04-07  0:00       ` Robert Dewar
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
1998-04-10  0:00         ` Larry Kilgallen
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
replies disabled

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