From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:5750:: with SMTP id 16mr38276933qtx.305.1608056099957; Tue, 15 Dec 2020 10:14:59 -0800 (PST) X-Received: by 2002:ae9:e64d:: with SMTP id x13mr13532018qkl.464.1608056099747; Tue, 15 Dec 2020 10:14:59 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 15 Dec 2020 10:14:59 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.31.100.133; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.100.133 References: <0c0ddb8e-6a82-473d-8143-f4076242f520n@googlegroups.com> <86r1ntntb3.fsf@stephe-leake.org> <0ded905f-94ac-4470-936c-7f1cb19ac798n@googlegroups.com> <82e629ea-bd59-417a-9185-dd6094e396c1n@googlegroups.com> <570e9d30-0b33-45f0-a9fe-163cc810a770n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Possible to recover default value of scalar type? From: AdaMagica Injection-Date: Tue, 15 Dec 2020 18:14:59 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:60867 List-Id: Simon Wright schrieb am Dienstag, 15. Dezember 2020 um 17:54:01 UTC+1: > I suppose the compiler could still detect & warn about inadvertent use > of the don't-care value. Just a story about my work (long ago): Our coding standard required for every type declaration a default value that indicated an uninitialised value: type T is ... Nd_T: constant T := ...; -- Nd: not defined X: T := Nd_T; -- required The idea was that this Nd value should be thus that it would be likely to produce an exception when used in an expression. Also any change of this value should have absolutely no effect on the code. In any case, at some time it was decided that the Nd value for numeric types was 0. The effect: It was no longer possible to see whether in a declaration like X: T := Nd_T; this values denoted a truly undefined value or a concrete and correct initial value.