comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: little precision about anonymous access types
Date: Thu, 17 May 2018 16:17:04 -0500
Date: 2018-05-17T16:17:04-05:00	[thread overview]
Message-ID: <pdkrgg$n3g$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: d294e4a5-864c-4ab0-bf60-6c9a94ace651@googlegroups.com

"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.


  parent reply	other threads:[~2018-05-17 21:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19  0:37 little precision about anonymous access types Mehdi Saada
2018-03-19  1:08 ` Mehdi Saada
2018-03-19  1:18 ` Mehdi Saada
2018-03-19 14:51   ` AdaMagica
2018-03-19 22:40 ` Randy Brukardt
2018-03-20 17:49   ` G. B.
2018-03-20 23:56     ` Mehdi Saada
2018-03-21 22:46       ` Randy Brukardt
2018-05-15  0:20         ` Mehdi Saada
2018-05-15  0:28           ` Mehdi Saada
2018-05-15 21:48             ` Randy Brukardt
2018-05-16  8:14               ` Mehdi Saada
2018-05-16  8:23                 ` Mehdi Saada
2018-05-17 21:20                   ` Randy Brukardt
2018-05-17 21:17                 ` Randy Brukardt [this message]
2018-05-17 21:36                   ` J-P. Rosen
2018-05-18  7:44                   ` Dmitry A. Kazakov
2018-05-15 21:44           ` 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