From: "Kevin Wilson" <Kevin.Wilson@konstanz.netsurf.de>
Subject: Use of constants on EFA
Date: 1997/11/05
Date: 1997-11-05T00:00:00+00:00 [thread overview]
Message-ID: <63qkmc$8va$1@uttwil.bodensee.com> (raw)
For Eurofighter software we must conform to the following coding
standards :
EF Software Programmer's Manual PL-J-019-V-1101 Issue 4 April 1992
which contains a section saying :
5.4.2.1 Constants
Objects shall be defined as being constant if their value is fixed
throughout the execution of the software.
As would be expected we have taken this to mean that if a variable is fixed
within its scope (whatever this may be) then it should be a constant.
So for example
declare
Status : constant Status_Type := Get_Status ;
begin
if Status = Good
then
Do_This ;
else
Do_That ;
end if ;
end ;
would be OK.
However our customer (who must accept our code) states that constants
should only be declared at package level. They argue that in the
above example the constant will change its value if the code is executed
again, therefore is not fixed !
Apart from the question of good programming practice, we rely heavily
on declaring local constants to read unconstrained array structures
returned by functions and without this would require untidy interfaces
and I would imagine more memory.
Any comments on this would be appreciated or if there are any people
reading this who were involved in the writing of this document and can
clarify what was meant by this statement please let me know.
K.Wilson
next reply other threads:[~1997-11-05 0:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-11-05 0:00 Kevin Wilson [this message]
1997-11-05 0:00 ` Use of constants on EFA Robert Dewar
1997-11-06 0:00 ` Peter Hermann
1997-11-05 0:00 ` Robert Dewar
1997-11-06 0:00 ` Matthew Heaney
[not found] ` <01bceece$4a6a85e0$423c63c3@default>
1997-11-11 0:00 ` Michael F Brenner
1997-11-12 0:00 ` Karel Th�nissen
1997-11-12 0:00 ` Dale Stanbrough
1997-11-17 0:00 ` KevinWilson
[not found] ` <01bcefb3$a8ac9b80$a93163c3@default>
1997-11-17 0:00 ` Richard Toy
-- strict thread matches above, loose matches on Subject: below --
1997-11-10 0:00 Tom Moran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox