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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.183.193 with SMTP id h184mr4395021iof.129.1513773217455; Wed, 20 Dec 2017 04:33:37 -0800 (PST) X-Received: by 10.157.14.137 with SMTP id 9mr307494otj.14.1513773217356; Wed, 20 Dec 2017 04:33:37 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no667229itg.0!news-out.google.com!b73ni2243ita.0!nntp.google.com!i6no663746itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 20 Dec 2017 04:33:36 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:909f:18bb:7d1a:84ad; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:909f:18bb:7d1a:84ad References: <1ac5a44b-4423-443a-a7bb-2864d9abe78f@googlegroups.com> <3df6404a-588d-4e2d-a189-1d1e32ce9f5d@googlegroups.com> <73b4a9bd-1f3b-42b9-9ef7-5303b0a88794@googlegroups.com> <427478f8-298f-49b3-9cc1-4cfd58da6bd4@googlegroups.com> <4b355dd2-b7c2-495a-8377-306b500fcb78@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Prefixed notation for non tagged types From: Robert Eachus Injection-Date: Wed, 20 Dec 2017 12:33:37 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3259 X-Received-Body-CRC: 1302889110 Xref: reader02.eternal-september.org comp.lang.ada:49547 Date: 2017-12-20T04:33:36-08:00 List-Id: On Tuesday, December 19, 2017 at 6:05:01 PM UTC-5, Randy Brukardt wrote: > Assuming that you want it to work for private types, the only choices are= =20 > "all types" or "tagged types", because any type can complete a normal=20 > private type, and having something available for a private type that is n= ot=20 > available for the full type leads directly to madness. Go directly to madness. Do not pass Go. Do not collect $200. ;-) Seriously, the visibility rules were hard fought way back in the early eigh= ties. There were lots of 'nice' features thrown out because the corners ei= ther resulted in the "wrong" function being called, or two definitions hidi= ng each other. The only one I know of that we missed was: function Foo return Integer is begin return 3; end; function Foo (X: in Integer :=3D 4) return Integer is begin return X; en= d; ... Y: Integer :=3D Foo; -- ambiguous There is no way to call the first Foo, or for that matter call the second F= oo with a default argument! Of course, the real "fix" is just don't do tha= t. (The case where one Foo is directly visible and the other is use-visible= has a rule that favors the directly visible declaration. Again madness avo= idance, adding a use clause will not change the meaning of the code within = the scope of the program. If it means that there are now two use-visible h= omographs, the use clause can make the code illegal, but the fix is obvious= .)