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-24 15:55:56 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Dispatching and generics - language lawyer question Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Wed, 24 Jul 2002 22:55:18 GMT References: NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:27371 Date: 2002-07-24T22:55:18+00:00 List-Id: "Grein, Christoph" writes: > For untagged types, _redefined_ equality does not correctly compose and > _predefined_ equality reemerges in generics if not properly transferred by a > formal parameter: What do you think the rule *should* be? It does seem bad that predefined "=" reemerges. And of course the rule for "/=" should be the same as for "=". What about "<"? Should the predefined one reemerge? If a generic sorting package calls the primitive "<" of the generic formal type, it would seem desirable to use the user-defined one, rather than the predefined one. 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. - Bob