From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: GNAT GPL 2013 bug?
Date: Mon, 12 Aug 2013 09:52:29 -0700 (PDT)
Date: 2013-08-12T09:52:29-07:00 [thread overview]
Message-ID: <4589f4c3-a1c7-4fa7-9b79-89a9917502bf@googlegroups.com> (raw)
In-Reply-To: <k71biho5pjg7.16zreugtnwyc6$.dlg@40tude.net>
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; if the parameter is null, the dispatch cannot work.
I'm really not clear at all on what point you're trying to make.
-- Adam
next prev parent reply other threads:[~2013-08-12 16:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 9:47 GNAT GPL 2013 bug? Dmitry A. Kazakov
2013-08-09 10:38 ` sbelmont700
2013-08-09 11:01 ` Dmitry A. Kazakov
2013-08-09 11:06 ` sbelmont700
2013-08-09 11:36 ` Dmitry A. Kazakov
2013-08-09 15:48 ` Adam Beneschan
2013-08-09 16:11 ` Simon Wright
2013-08-09 16:52 ` Adam Beneschan
2013-08-09 18:25 ` Simon Wright
2013-08-09 18:39 ` Adam Beneschan
2013-08-09 19:28 ` Adam Beneschan
2013-08-09 20:05 ` Robert A Duff
2013-08-09 20:30 ` Adam Beneschan
2013-08-09 21:35 ` Simon Wright
2013-08-10 15:10 ` Shark8
2013-08-09 16:03 ` Simon Wright
2013-08-09 18:55 ` Randy Brukardt
2013-08-09 19:27 ` Dmitry A. Kazakov
2013-08-09 20:04 ` Robert A Duff
2013-08-10 6:51 ` Dmitry A. Kazakov
2013-08-12 16:52 ` Adam Beneschan [this message]
2013-08-12 17:03 ` Dmitry A. Kazakov
2013-08-12 17:20 ` Adam Beneschan
2013-08-12 18:34 ` Dmitry A. Kazakov
2013-08-12 20:12 ` Randy Brukardt
2013-08-13 6:43 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox