comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT GPL 2013 bug?
Date: Mon, 12 Aug 2013 20:34:00 +0200
Date: 2013-08-12T20:34:00+02:00	[thread overview]
Message-ID: <1sjqnkpq64coc$.1xmhu8h9q4qua$.dlg@40tude.net> (raw)
In-Reply-To: b984f511-040c-4721-a800-95fbbbe07314@googlegroups.com

On Mon, 12 Aug 2013 10:20:05 -0700 (PDT), Adam Beneschan wrote:

> On Monday, August 12, 2013 10:03:14 AM UTC-7, Dmitry A. Kazakov wrote:
> 
>> 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.
> 
> Well, from the point of view of dynamic semantics, a call to a dispatching
> subprogram *has* to fail if given a null parameter.

A dispatching call, you mean, and not fail, but propagate Constraint_Error.
And that does not imply that a non-dispatching call have to. Semantically
they are different.

> There's no way around this.

Actually there is one. Access type is a by-value type. As such it could
have non-tagged classes, using the standard scheme:

   T -> Value
   T'Class -> (T'Tag, Value)

So null access T'Class would become (T'Tag, null) rather than bare null.
Which would make it possible to dispatch on it without assuming that the
target body is always (begin raise Constraint_Error; end). Not that
dispatching on null would be terribly useful, of course...

> So, dynamically, it's going to behave like a null-excluding access
> type no matter what.

Yes, though, as I said, it is because of access T'Class. It is not because
there is something wrong with access T. Smoke and mirrors.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2013-08-12 18:34 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
2013-08-12 17:03               ` Dmitry A. Kazakov
2013-08-12 17:20                 ` Adam Beneschan
2013-08-12 18:34                   ` Dmitry A. Kazakov [this message]
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