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.9 required=5.0 tests=BAYES_00 autolearn=ham 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-21 08:22:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Mon, 21 Oct 2002 17:22:14 +0200 Message-ID: References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> <3DB079ED.2070200@attbi.com> <3ZTs9.1528$Bd4.11780@dfw-service2.ext.raytheon.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1035213734 27057231 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:29990 Date: 2002-10-21T17:22:14+02:00 List-Id: On Mon, 21 Oct 2002 09:13:53 -0500, Wes Groleau wrote: >Dmitry A.Kazakov wrote: >> Then the language shall require them to be either initialized or >> *explicitly* specified as uninitialized: > >It already does: > > O : Some_Type; -- explicitly uninitialized > O : Some_Type := Default; -- explicitly initialized > >It's fairly obvious which is which, and there is no third option >that I know of. Computer is a deterministic system, so one could claim that everything is explicit. I would not count O : Some_Type; for an explicit specification that O is uninitialized. 1. In case of controlled, access, task, protected object types, O *is* initialized. 2. In any case the syntax form for an uninitialized variable should be no shorter than another (safer) one. For example: O : Some_Type := <>; or O : Some_Type with null; >> procedure Foo (X : out Integer := 23); > >That's obviously explicitly initialized. The point is that *maybe* procedure Foo (X : out Integer); should be made illegal for types which have no reasonable initial value, because there is a possibility that X will be left unset. If it is a desired behavior then probably it would be better to make it clear from the specification. >> function Foo returns Integer := 23; > >You're saying that instead raising program_error for failing to hit >a return statement we should look to a default result on the spec? Raising an exception is a run-time fault, which is usually too late. As for looking in spec, well, for what ever reason Ada requires that all defaults be repeated in the bodies (:-)) --- Regards, Dmitry Kazakov www.dmitry-kazakov.de