comp.lang.ada
 help / color / mirror / Atom feed
* When/Why can a compiler reject an operator but accept a name?
@ 2002-07-05 17:08 Wes Groleau
  2002-07-06 23:26 ` Robert A Duff
  2002-07-08 12:17 ` Antonio Duran
  0 siblings, 2 replies; 5+ messages in thread
From: Wes Groleau @ 2002-07-05 17:08 UTC (permalink / raw)


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.

Does using an operator instead of a name make the
function Intrinsic?

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!)

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-08 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2002-07-08 15:22   ` Wes Groleau
2002-07-08 12:17 ` Antonio Duran
2002-07-08 15:27   ` Wes Groleau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox