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!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.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: little precision about anonymous access types Date: Thu, 17 May 2018 16:17:04 -0500 Organization: JSA Research & Innovation Message-ID: References: <42387d28-c983-4e58-9522-815ccd1ad0fb@googlegroups.com> <6c1e643d-b826-4b8b-b61c-13c56428ed23@googlegroups.com> Injection-Date: Thu, 17 May 2018 21:17:05 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="23664"; 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; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:52407 Date: 2018-05-17T16:17:04-05:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:d294e4a5-864c-4ab0-bf60-6c9a94ace651@googlegroups.com... > So if it was you, you would have treated subprograms with >access types parameters as primitives, as long as they are declared >in the same immediate scope ? It sounds simple, why hasn't it be >do that way ? No, I wouldn't bother with dispatching on access values at all. Since Ada passes all tagged objects by reference, and 'Unchecked_Access is always allowed on tagged parameters, it's always possible to get an access to a tagged parameter if that is needed. There's no reason to *pass* that value - just pass the tagged object. Essentially, there's no implementation difference (ignoring the abomination of dynamic accessibility) between "access T" and "in out T" for a tagged type T. So the former is not really needed - at best it saves 4 characters on calls (".all"), but in many circumstances it adds complication (needing to add "aliased" and "'Access" in various places). Randy.