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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Anonymous Access and Accessibility Levels Date: Tue, 23 Apr 2019 18:47:26 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Tue, 23 Apr 2019 23:47:26 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="15607"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:56181 Date: 2019-04-23T18:47:26-05:00 List-Id: "Dmitry A. Kazakov" 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.