On Apr 30, 12:15 am, Maciej Sobczak <see.my.homep...@[EMAIL PROTECTED]
> wrote:
> On 29 Kwi, 23:32, "Randy Brukardt" <ra...@[EMAIL PROTECTED]
> wrote:
>
> > Anonymous access types (a superset of access parameters) mainly exist
in Ada
> > to make it easier for C++ and Java programmers to move their rotten
designs
> > to Ada.
>
> Anonymous access types are used by Ada.Containers for iteration (among
> others).
I suspect that Randy was talking only about anonymous access-to-object
parameters. Those aren't used by the language's definition of
Ada.Containers, or at least I didn't spot any.
Anonymous access-to-subprogram parameters (which Ada.Containers does
use) are a different animal altogether. They do serve a legitimate
purpose; downward closures are im****tant but couldn't be done
satisfactorily in Ada 95. In a way, I think that calling this an
"access" parameter is more of a syntax choice than a real "access"
thingy. Anonymous access-to-subprogram parameters can't be stored in
variables and thus don't really serve the same purposes as other
access types; for that reason, I think the designers could have done
this without an "access" type, simply by saying they would pass a
procedure or function around, as is done in Algol and Pascal, I
believe. But doing it as an access type fits in well with the
language rules and syntax that already existed in Ada 95. Just my
humble opinion here...
-- Adam


|