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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Overloading operator "=" for anonymous access types? Date: Tue, 15 Jan 2019 15:00:31 -0600 Organization: JSA Research & Innovation Message-ID: References: <167dc83d-daac-49eb-ba79-48866ccde39d@googlegroups.com> <0c56d9f4-8861-4c74-b170-a973e3789b08@googlegroups.com> Injection-Date: Tue, 15 Jan 2019 21:00:32 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="3339"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Response Xref: reader01.eternal-september.org comp.lang.ada:55285 Date: 2019-01-15T15:00:31-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:q1k65j$1qqm$1@gioia.aioe.org... ... > [ The reference manual is shy to say anything about it. It claims that > universal_access is kind of class-wide, which would mean, if taken > seriously, that "=" overloads and must clash with the original "=". This is what happens. However, such a clash would mean that you could never write a user-defined "=" for an anonymous access type. That would have been a good idea, but it would have to have been enforced with a Legality Rule to be sensible. Some thought that bad because of compatibility, so... > Since it does not, universal_access is more like a parent type than > class-wide.] ...there is a hack to have a preference for the user-defined one. That doesn't change the the fact that universal_access is class-wide, it just make it possible to write a user-defined operator. >P.S. And, wouldn't it be better to fix the type system, no? This wart would be one of the things that would make "fixing the type system" so much harder. A proper solution (and the one we should have used in the first place) is to declare a "=" for every access type. I think we wanted to avoid that as anonymous access can be declared in places where declarations aren't allowed, so we came up with something worse. :-) It's the idea of anonymous access types that destroys the type system that you have in mind. Your system keeps the types and operations together, and that makes no sense for an anonymous type (what are the operations for an anonymous type, and where are they declared? Any answer is either magical or nonsense.) One has to get rid of nonsense things before one could regularize the type system, especially upon the lines you have been suggesting for years. It's not really possible for Ada; you would end up with an Ada-like language. Randy. This is just another Ada