comp.lang.ada
 help / color / mirror / Atom feed
From: "Michael B." <michaelb@example.com>
Subject: Re: Access parameters and accessibility
Date: Tue, 16 Dec 2014 20:46:57 +0100
Date: 2014-12-16T20:46:57+01:00	[thread overview]
Message-ID: <m6q27d$l4s$1@speranza.aioe.org> (raw)
In-Reply-To: m6onu3$6or$1@loke.gir.dk

On 12/16/14 08:45, Randy Brukardt wrote:
> We in the ARG call discussing accessibility a "trip to the Heart of
> Darkness", and indeed, 3.10.2 is now informally called the "Heart of
> Darkness". I even put that into an AARM note (3.10.2(3.b/3)). Only the
> desperate or foolhardy venture there.

Heart of Darkness?! When reading this part of the ARM it felt a little 
bit weird. But I had no idea it could be *that* bad ;-).

> I had heaard about the issue that John mentions in this paragraph, but I
> never understood it (I don't think Janus/Ada does it). I've had it explained
> to me a couple of times, and I sort of understand it, but you'd have to pay
> me to spend an hour finding an example and writing up an appropriate
> explanation. It's that draining - I wouldn't do it for free. Sorry.

Does that mean I should give up on that issue as I will never be able to 
understand it?

> Besides, I agree with the others that it has nothing to do with OOP. Claw
> only uses anonymous access parameters to get the effect of in out parameters
> in functions (which isn't a problem with Ada 2012 anyway), and as Dmitry
> noted, it doesn't work very well. Anonymous access parameters: just say no!!

How can I avoid them when they are heavily used in so many libraries?
E.g. GtkAda: I just looked into some arbitrary .ads files from Gnat GPL 
2014 (glib-string.ads, glib-object.ads and gdk-event.ads) and found 
examples of the usage of anonymous access parameters.
You could argue that this is bad design, but rewriting all this code is 
not really an option for me.
And compared to writing GUIs in plain C it seems to be the lesser of two 
evils.

> Finally, the model that John is talking about isn't sufficient to implement
> dynamic accessibility checks in Ada 2005 or Ada 2012. He's really talking
> about an implementation short-cut that should be irrelevant to understanding
> the feature anyway. (That is, it doesn't even belong in his book.) And that
> short-cut doesn't work. Indeed, no Ada compiler has ever actually
> implemented correct accessibility checking for Ada 2005 or later. We believe
> it is possible (Steve Baird and I have worked out correct implementation
> models, but no one has tried either yet). We're supposed to be writing an
> Ada-Europe paper -- but of course that requires a trip to the Heart of
> Darkness, and neither of us has been in much a hurry to take that trip!

I'm looking forward to read this paper!

> The only thing to worry about vis-a-vis dynamic accessibility checking is
> that the object has to have a lifetime the same or longer than the access
> type.

At least this rule is easy to understand :-).

Regards,

Michael


  parent reply	other threads:[~2014-12-16 19:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 16:52 Access parameters and accessibility Michael B.
2014-12-15 17:54 ` Dmitry A. Kazakov
2014-12-15 18:48   ` Jeffrey Carter
2014-12-15 20:23     ` Michael B.
2014-12-15 21:02       ` Dmitry A. Kazakov
2014-12-16  1:10 ` sbelmont700
2014-12-16 13:57   ` Michael B.
2014-12-16 14:12     ` Georg Bauhaus
2014-12-16 21:34     ` sbelmont700
2014-12-17 14:30       ` Michael B.
2014-12-17 15:41         ` sbelmont700
2014-12-18 17:48           ` Michael B.
2014-12-17 16:03         ` Adam Beneschan
2014-12-18 16:07           ` Michael B.
2014-12-16  7:45 ` Randy Brukardt
2014-12-16  8:48   ` Stefan.Lucks
2014-12-16 20:47     ` Randy Brukardt
2014-12-16 21:24       ` Georg Bauhaus
2014-12-16  9:08   ` Natasha Kerensikova
2014-12-16 10:00     ` Dmitry A. Kazakov
2014-12-16 14:57     ` Robert A Duff
2014-12-16 19:46   ` Michael B. [this message]
2014-12-16 20:59     ` Randy Brukardt
2014-12-17  7:02       ` Natasha Kerensikova
2014-12-17  8:28         ` Dmitry A. Kazakov
2014-12-17  9:06           ` Natasha Kerensikova
2014-12-17 22:58             ` Randy Brukardt
2014-12-17 22:25         ` Randy Brukardt
2014-12-18  0:47         ` Shark8
2014-12-17  2:02     ` Adam Beneschan
2014-12-17 23:18       ` Randy Brukardt
2014-12-18  0:56         ` Robert A Duff
2014-12-18  1:17           ` Randy Brukardt
2014-12-18  5:29             ` Shark8
2014-12-18 23:12             ` Randy Brukardt
2014-12-18  8:27         ` Dmitry A. Kazakov
2014-12-18 21:20           ` Randy Brukardt
2014-12-19 12:16 ` Michael B.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox