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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: GNAT GPL 2013 bug? Date: Mon, 12 Aug 2013 19:03:14 +0200 Organization: cbb software GmbH Message-ID: <1evw1coxfrfu5$.1atfpln47qs0j.dlg@40tude.net> References: <19fr4wmxmen$.gjbias2fj461$.dlg@40tude.net> <1pe6z4dg2xk9j$.1wdn31ijaldz3.dlg@40tude.net> <4589f4c3-a1c7-4fa7-9b79-89a9917502bf@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: RXJ+FkxPc8/mFTAaIGiJWQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:16822 Date: 2013-08-12T19:03:14+02:00 List-Id: On Mon, 12 Aug 2013 09:52:29 -0700 (PDT), Adam Beneschan wrote: > On Friday, August 9, 2013 11:51:34 PM UTC-7, Dmitry A. Kazakov wrote: >> On Fri, 09 Aug 2013 16:04:02 -0400, Robert A Duff wrote: > >> I can "dispatch" on null anyway: >> >> type T is tagged null record; >> procedure P (X : T) is null; >> procedure R (X : access T'Class); >> >> procedure R (X : access T'Class) is >> begin >> X.P; >> end R; > > But I could write > > procedure R (X : access T'Class) is > begin > if X = null then > -- take some special default action > else > X.P; > end if; > end R; > > The point is that when a caller calls R, the above procedure is simply > called. So it will work to call it with a null parameter; the code in R > may later run into a Constraint_Error or not, depending on how it's > written, but there's no problem calling R. But when P is called, the > dispatching occurs *at* *that* *point*, before any code in any of the P > procedures is executed; It is irrelevant for the client (= user = program semantics) where that check is placed, an implementation detail, nothing more. > if the parameter is null, the dispatch cannot > work. > > I'm really not clear at all on what point you're trying to make. That implied null-exclusion for controlling parameters does not change/save anything. Just added language weirdness that "access T" is subtype conformant to "not null access T" depending on T !, for apparently no gain. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de