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,c08a7609345f4e5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!x42g2000yqx.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Thu, 30 Sep 2010 00:33:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: <586bdb21-1105-4fd2-bcb7-116be8c92517@x42g2000yqx.googlegroups.com> References: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> <82y6ajg07m.fsf@stephe-leake.org> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1285832013 534 127.0.0.1 (30 Sep 2010 07:33:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Sep 2010 07:33:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x42g2000yqx.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14325 Date: 2010-09-30T00:33:33-07:00 List-Id: Stephen Leake wrote on comp.lang.ada: > Ludovic Brenta writes: >> I generally think twice or three times before declaring an access type >> in the same package as the object type. In fact, I think twice before >> declaring any access type at all :) To me, an access type makes the >> package unclean. >> >> Since, in Ada, all objects of tagged types are passed by reference and >> since Ada has class-wide types, you do not need any access type to >> achieve pass-by-reference semantics or dynamic dispatching. This >> leaves dynamic memory allocation as the only remaining justification >> for access types. > > You left out accessibility checks, which are an important reason for > named access types. Yes, that's why I generally prefer named access types over anonymous access types, but you don't use access values just because of accessibility checks, do you? -- Ludovic Brenta.