From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: When/Why can a compiler reject an operator but accept a name?
Date: Sat, 6 Jul 2002 23:26:48 GMT
Date: 2002-07-06T23:26:48+00:00 [thread overview]
Message-ID: <wccwus8mo93.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 3D25D271.ACE6DAC8@despammed.com
Wes Groleau <wesgroleau@despammed.com> 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
next prev parent reply other threads:[~2002-07-06 23:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-05 17:08 When/Why can a compiler reject an operator but accept a name? Wes Groleau
2002-07-06 23:26 ` Robert A Duff [this message]
2002-07-08 15:22 ` Wes Groleau
2002-07-08 12:17 ` Antonio Duran
2002-07-08 15:27 ` Wes Groleau
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox