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: a07f3367d7,9cccd7364739aea1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!postnews.google.com!a39g2000pre.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Passing the same actual as both in and out formal parameters? Date: Tue, 17 Nov 2009 16:23:56 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1fbe454c-52b0-408b-9159-982fc019a53c@j19g2000yqk.googlegroups.com> <7dde1f20-1b53-4ccf-8344-a60c9f500130@s21g2000prm.googlegroups.com> 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 1258503836 23022 127.0.0.1 (18 Nov 2009 00:23:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Nov 2009 00:23:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a39g2000pre.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),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8136 Date: 2009-11-17T16:23:56-08:00 List-Id: On Nov 17, 4:11=A0pm, "Jeffrey R. Carter" wrote: > Randy Brukardt wrote: > > > Right, that's my understanding of the point. The only problem is, there > > isn't any sane way to describe such an assertion. > > Given that the types are by-reference, would comparing 'access of the par= ameters > =A0 serve? > > pragma Assert (A'access /=3D B'access); First of all, for this to work in the general case, that would need a major change in language semantics, since you need an access type in order for 'Access to be allowed. The only way this would be legal is if there happened to be exactly one "=3D" operator directly visible with operands of some named access-to-T type. (Also, if "=3D" were overridden with a user-defined operator that did something unexpected, it would fail, but nobody would do that.) Second, it only catches the case where the operands are of the same type; it won't catch other overlaps such as P2 (A =3D> Object, B =3D> Object.Component); -- Adam