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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,18f7f6e041b3e0bf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-25 09:07:39 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!world!news From: "Ben Brosgol" Subject: Re: Dispatching and generics - language lawyer question X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: X-Priority: 3 Date: Thu, 25 Jul 2002 15:46:45 GMT X-Msmail-Priority: Normal References: NNTP-Posting-Host: ppp0b189.std.com Organization: The World @ Software Tool & Die X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:27404 Date: 2002-07-25T15:46:45+00:00 List-Id: > > For untagged types, _redefined_ equality does not correctly compose and > > _predefined_ equality reemerges in generics if not properly transferred by a > > formal parameter: > > But what about "+" and "mod" and so forth? Package Text_IO.Integer_IO > probably uses the predefined "mod" to format the number as a string. > But the *spec* of that package doesn't say that -- it just says the > string is formatted according to some rules. If the predefined "mod" > did *not* reemerge, then a user-defined "mod" operator would break > Text_IO.Integer_IO. You may say, "tough luck; that's the programmer's > fault". But how should the semantics of Integer_IO be defined in the > RM? Surely the use of "mod" there is an implementation detail. As another interesting case, suppose that you declare an integer type T with "mod" specified as abstract. If "mod" on the formal type is invoked from the generic body, then either the instantiation Ada.Text_IO.Integer_IO(T) would need to be rejected (a rather flagrant violation of the "contract model") or else the predefined "mod" would need to reemerge.