From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,59d24b21703c2885,start X-Google-Attributes: gid103376,public From: "Kevin Wilson" Subject: Use of constants on EFA Date: 1997/11/05 Message-ID: <63qkmc$8va$1@uttwil.bodensee.com>#1/1 X-Deja-AN: 287324382 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: ISC Konstanz, Germany Newsgroups: comp.lang.ada Date: 1997-11-05T00:00:00+00:00 List-Id: 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