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,fb4dd933ef563a8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-06 16:27:53 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: When/Why can a compiler reject an operator but accept a name? Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Sat, 6 Jul 2002 23:26:48 GMT References: <3D25D271.ACE6DAC8@despammed.com> 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:26914 Date: 2002-07-06T23:26:48+00:00 List-Id: Wes Groleau writes: > In package G I have: > > type List_Type is array (Natural range <>) of Item; > > type Order is access function (Left, Right : in Item) return > Boolean; > > procedure Sort (List : in out List_Type; Sequence : in Order); > > > In procedure P I had: > > package I is new G (Item); > > function "<" (Left, Right : in Item) return Boolean is > > ..... > > I.Sort (List => List, Sequence => "<"'Access); > > > Compiler rejected it, saying: > > "<" has no definition that matches function (Left, Right : in Item) > return Boolean [RM_95 3.10.2(32)] > > I replaced "<" with Ord_Check (no other changes), and > the compiler accepted it. Sounds like a compiler bug, although I can't be sure without seeing all the code (e.g., you didn't show the code for Ord_Check). > Does using an operator instead of a name make the > function Intrinsic? No. > If not, there is no support for rejection in 3.10.2(32) > Is there any reason elsewhere in the RM to justify this > odd behavior? > > (Certainly either way, the message could be improved!) True. Show us a complete example. - Bob