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,8ffd9ca0013db6a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-29 19:55:53 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!firehose.mindspring.com!not-for-mail From: Lao Xiao Hai Newsgroups: comp.lang.ada Subject: Re: Redefined "=" = generic disaster? Date: Sun, 29 Oct 2000 19:49:01 -0800 Organization: MindSpring Enterprises Message-ID: <39FCEFAD.56BE85B1@ix.netcom.com> References: <39F13ED9.1EE@li.net> <39F1C092.87D4135E@acm.org> <39F1F686.26B5@li.net> <8tecab$epm$1@nnrp1.deja.com> NNTP-Posting-Host: 3f.35.b7.f1 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 30 Oct 2000 03:53:10 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:1622 Date: 2000-10-30T03:53:10+00:00 List-Id: Robert Dewar wrote: > Please post exact Ada 95 code that works (check it out first) > and does something you consider unexpected. Could not resist posting this package specification and body in response to your challenge Robert. Before you read it, I admit it is silly to the point of being frivolous, but not that far removed from some code that actually finds its way into some designs. package Strange_Equality is type Strange is private; type Grisly is private; type Goulish is private; function "=" (G1 : Grisly; G2 : Goulish) return Strange; private type Strange is range -1..3; type Grisly is (Red, Yellow, Blue); type Goulish is digits 7; end Strange_Equality; with the following package body package body Strange_Equality is function "=" (G1 : Grisly; G2 : Goulish) return Strange is begin if Grisly'Pos(G1) = Integer(G2) then return Grisly'Pos(G1); else return Strange'First; end if; end "="; end Strange_Equality;