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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a6449b2443dcdda1 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!y18g2000pre.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Access keyword Date: Wed, 30 Apr 2008 08:16:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1209568602 31351 127.0.0.1 (30 Apr 2008 15:16:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 30 Apr 2008 15:16:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y18g2000pre.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21141 Date: 2008-04-30T08:16:42-07:00 List-Id: On Apr 30, 12:15 am, Maciej Sobczak wrote: > On 29 Kwi, 23:32, "Randy Brukardt" 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 important 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