comp.lang.ada
 help / color / mirror / Atom feed
From: "K. E. Garlington" <Kennie.E.Garlington@nospam.lmco.com>
Subject: Re: Two more AQS-95 questions
Date: 1998/02/05
Date: 1998-02-05T00:00:00+00:00	[thread overview]
Message-ID: <34D9DF1F.33B8@nospam.lmco.com> (raw)
In-Reply-To: 34D60055.1FFF@gc057.fw.hac.com


Wes Groleau wrote:
> 
> 1)  In 3.2.6, why "use a constant ... when the value must be static"
>     but "named numbers, ... whenever possible."  Isn't a named number
>     static?  Is there an advantage to a (typed) constant for
>     "staticness" ?

Just for the record, the rationale given for using a named number
instead of a constant is:

"Named numbers allow compilers to generate more efficient code than for
constants and to perform more complete error checking at compile time."

I've seen the efficiency effect sporadically (not enough to use it as
justification in this case); how the error checking advantage accrues is
beyond me.

I wonder if this is just a misinterpretation of another rule in the set;
that it's sometimes better to write a constant declaration in terms of
an equation of named numbers rather than a single literal?




  parent reply	other threads:[~1998-02-05  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-02  0:00 Two more AQS-95 questions Wes Groleau
1998-02-03  0:00 ` Robert Dewar
1998-02-05  0:00 ` K. E. Garlington [this message]
1998-02-05  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