comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Anonymous Access and Accessibility Levels
Date: Tue, 23 Apr 2019 18:47:26 -0500
Date: 2019-04-23T18:47:26-05:00	[thread overview]
Message-ID: <q9o86e$f7n$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: q9mfor$1fn6$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:q9mfor$1fn6$1@gioia.aioe.org...
> On 2019-04-23 00:11, Randy Brukardt wrote:
>
>> (3) Think three times before depending upon access parameter dispatching 
>> and
>> anonymous access-to-subprograms.
>
> So long there is no way to pass a subprogram as a parameter anonymous 
> access to subprogram remain unavoidable.

True, but that was my point: "Complain to the ARG where the capabilities 
aren't available with named access types". The fact that these things are 
anonymous mean you have to give the declaration on every silly usage, that 
you can't give contracts or other properties (no aspects for anonymous 
types), and the readability suffers because of the nested parameter lists.

...
> What do you have against dispatching access parameters? I think of it as 
> once we have access types, we should also have controlling access 
> parameters. If we want to push for all named access types then we need 
> some form of multi-methods:
>
>    type T is tagged ...
>    type T_Ptr is access T;
>    procedure Foo (X : T_Ptr); -- I want this in T'Class, somehow
>
>    type S is new T with ...;
>    overriding procedure Foo ... -- How?

I'd prefer to avoid using access types in specs altogether. But I do realize 
that some sort of reference is needed. I've been working on the 
"simultaneous derivation" problem posed by such types (for instance a Vector 
and Cursor ought to be derived together). I think I've found an actual 
solution, but it's likely too late for Ada 2020 (and it won't work for the 
existing containers, as it involves having multiple different tagged types 
as parameters, which is currently illegal).

                                    Randy.



  reply	other threads:[~2019-04-23 23:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 15:29 Anonymous Access and Accessibility Levels Jere
2019-04-20 15:58 ` J-P. Rosen
2019-04-22 22:03   ` Randy Brukardt
2019-04-24 10:42   ` Jere
2019-04-24 23:27     ` Randy Brukardt
2019-04-26  2:47       ` Optikos
2019-05-11 11:58         ` Jere
2019-04-26 17:12     ` G.B.
2019-05-11 12:06       ` Jere
2019-05-14  0:03         ` Randy Brukardt
2019-04-22 22:11 ` Randy Brukardt
2019-04-22 22:23   ` Shark8
2019-04-23 23:42     ` Randy Brukardt
2019-04-23  7:44   ` Dmitry A. Kazakov
2019-04-23 23:47     ` Randy Brukardt [this message]
2019-04-24 10:34   ` Jere
2019-04-24 10:44     ` Jere
2019-04-24 23:21       ` Randy Brukardt
replies disabled

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