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-22 03:07:51 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!dialin-145-254-041-110.arcor-ip.NET!not-for-mail From: Dmitry A.Kazakov Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Wed, 23 Oct 2002 00:15:54 +0200 Message-ID: References: <3ZTs9.1528$Bd4.11780@dfw-service2.ext.raytheon.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-041-110.arcor-ip.net (145.254.41.110) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1035281268 27977371 145.254.41.110 (16 [77047]) User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:30021 Date: 2002-10-23T00:15:54+02:00 List-Id: Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > :>> procedure Foo (X : out Integer := 23); > : procedure Foo (X : out Integer); > :>> function Foo returns Integer := 23; > > Anything wrong with explicitly passing a success indication > parameter or a default value? For example, > > function foo(default: integer:= 23) return Integer; That's another case. First of all I am not so pretty sure about function return values, because Ada has an explicit return statement and no explicit result variable. It is sometimes good, sometimes bad, but it is another story. My concern is out parameters which may be left unset. It is very unlikely with function results, so I mentioned them merely for the sake of language regularity (function result is a special case of an out parameter). Secondly, your example refers to program semantics, not syntax. Semantics cannot be checked or verified neither formally nor by a human being. One of good ideas of Ada design as I see it, was to *syntactically* mark the constructs which are potentially dangerous, make them visible for both who writes and who reads the program. Because an uninitialized thing is a potential breach it should be made not disallowed, but just visible. Compare it with the case statement, which requires an explicit "when others" when not all alternatives are covered. A similar thing which was mentioned in c.l.a sometime ago. The default of a declaration should be a constant, not a variable. > : [...] 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. -- Regards, Dmitry Kazakov www.dmitry-kazakov.de