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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9506fd4dcf7090 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-19 06:53:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!dialin-145-254-044-186.arcor-ip.NET!not-for-mail From: Dmitry A.Kazakov Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Sun, 20 Oct 2002 04:01:13 +0200 Message-ID: References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> <3DB079ED.2070200@attbi.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-044-186.arcor-ip.net (145.254.44.186) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1035035590 26151334 145.254.44.186 (16 [77047]) User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:29943 Date: 2002-10-20T04:01:13+02:00 List-Id: Mark Biggar wrote: > Programmer Dude wrote: >> I'm new to, and just beginning to explore, Ada. It surprised me that >> Ada allows evalutation of an uninitialized variable without saying >> *something* about it during compile. >> >> Surely I'm missing something? > > It should be obvious that the general problem of detecting all > accesses to uninitialized variables is equivalent to the halting > problem. So it is impossible for a compiler to do a perfect job, thus > some form of run-time detection or action is necessary anyway. So the > LRM can't require compile time detection, so it makes it optional. The > LRM does allow compilers to warn you when you write code that will > always raise an expection and as raising Program_Error is one of the > allowed run-time responses to accessing an uninitialized variable the > LRM does allows for optional warnings for this case. If your complier > doesn't issue such warnings, it's only a "quality of implementation" > issue not a compiler bug. I think you missed the point. The question was about the language not a compiler. It is true that no compiler can detect all uninitialized variables. So? Then the language shall require them to be either initialized or *explicitly* specified as uninitialized: X : Integer with null; -- or some other syntax Maybe one should require this also for out-parameters (via default value): procedure Foo (X : out Integer := 23); function Foo returns Integer := 23; -- Regards, Dmitry Kazakov www.dmitry-kazakov.de