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 Path: g2news1.google.com!postnews.google.com!h40g2000pro.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Thu, 30 Sep 2010 09:03:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> <82y6ajg07m.fsf@stephe-leake.org> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285862618 5872 127.0.0.1 (30 Sep 2010 16:03:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Sep 2010 16:03:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h40g2000pro.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14337 Date: 2010-09-30T09:03:37-07:00 List-Id: On Sep 30, 12:27=A0am, Stephen Leake wrote: > 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. Really? Most uses of anonymous access types still involve accessibility checks. The main case where they don't is access parameters; and in that case, you usually don't want accessibility checks unless you're going to store the parameter somewhere where it could live after the subprogram is completed, and doing so is going to involve an accessibility check at the point where it's stored, whether or not the type of the stored data is named or anonymous. This should all be crystal clear from reading 3.10.2. (I'm kidding about that last. Nothing about 3.10.2 is clear. The only reason I recommend reading 3.10.2 is because I own stock in Advil.) -- Adam