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,cda33fc7f63c2885 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-18 01:17:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!not-for-mail Message-ID: <3C47E79E.7844@li.net> From: Vincent Marciante X-Mailer: Mozilla 3.0 (OS/2; I) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Overridability of _private_ predefined "=" [was Re: list strawman] References: <6i%_7.8890$fG.50588@rwcrnsc51.ops.asp.att.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 18 Jan 2002 04:15:10 -0500 NNTP-Posting-Host: 168.191.118.132 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 1011345385 168.191.118.132 (Fri, 18 Jan 2002 09:16:25 GMT) NNTP-Posting-Date: Fri, 18 Jan 2002 09:16:25 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:19038 Date: 2002-01-18T04:15:10-05:00 List-Id: Mark Lundquist wrote: > > "Thomas Wolf" wrote in message > news:MPG.16a629ebab6a7b63989682@news.ip-plus.net... > > Some comments on that Strawman 1.4 interface: > > > > 1. Generic formals > > ------------------ > > > > generic > > type Element is private; > > package Containers.Lists.Unbounded is > > > > I'd prefer > > > > generic > > type Element is private; > > with function "=" (Left, Right : Element) return Boolean is <>; > > package Containers.Lists.Unbounded is > > > > This allows users who have unconventional ideas of equality to provide > > their own routine, without requiring "normal" users to specify the > > equality function explicitly. > > Indeed it's a bug in Ada95 if the generic uses "=" without importing it > explicitly. Otherwise, an overridden "=" is not visible to the generic, and > predefined equality "reemerges". Its even worse than just that. Now a "block compare" of any composite type that has a nontagged private type as a componant is questional because that comparison will utilize the predefined "=" of the private type even though the creator of the private type may have seen it proper to overridden it. There was a thread, gosh, I guess less than two years ago where I was trying to argue that this was a disaster wrt generics and that reemergence of "=" seemed to be a special case wrt the whole reemergence issue. I now feel that the situation is very bad in general as opposed to being bad only wrt generics. Does anyone think that it would be good for there to be a change in the language such that for private types, if a primative "=" returning boolean exists then it should be the "=" used as part of block compares and that the predefined one should not reemerge in generics? This would not have been incompatible with Ada83, right? I hope that the above is not perceved as rehashing old arguments - I do not remember the issues having been discussed exactly as above. Vincent Marciante