comp.lang.ada
 help / color / mirror / Atom feed
From: Andrew Hoddinott <andrew@golter.demon.co.uk>
Subject: Re: Disagreement between GNAT and Cohen?
Date: Tue, 11 Jun 2002 16:23:05 +0900
Date: 2002-06-11T07:23:07+00:00	[thread overview]
Message-ID: <3D05A559.9020502@golter.demon.co.uk> (raw)
In-Reply-To: wcczny2tyrm.fsf@shell01.TheWorld.com

Robert A Duff wrote:


> See 8.5.4(5/1).
> 
> The AARM explains the reason for the rule: basically to make (efficient)
> implementation easier.


Thanks for that. I had somehow managed to read straight through that
paragraph without spotting the word Intrinsic :-S

I'm still puzzled though. Cohen's actual example (p. 696-7) is:

generic
   type Element_Type is (<>);
package Generic_Discrete_Sets is
   type Set_Type is private;
   function Union (Set_1, Set_2  : Set_Type ) return Set_Type;
   --  ... more functions and types
private
   type Set_Type is array (Element_Type) of Boolean;
end Generic_Discrete_Sets;

package body Generic_Discrete_Sets is
   function Union (Set_1, Set_2 : Set_Type) return Set_Type
      renames "or";
   --  ... more function bodies
end Generic_Discrete_Sets;

generating the errors:
generic_discrete_sets.adb:2:04: not subtype conformant with declaration
in package Standard
generic_discrete_sets.adb:2:04: return type does not match

He specifically draws attention to the package body using "the versions
of the logical operators 'and', 'or', and 'not' that apply component by
component to one-dimensional arrays of Boolean values", and bases an
exercise (15.3) around the example too.

Is he just making this up? Or is there some way that the frozen-ness of
the intrinsic logical operators can vary between compilers so that this
example sometimes works? And the intrinsic not getting an explicit
mention in the error message in this slightly more complex case is
because ... ?

Sorry. Since I know how to work around the problem, I should probably
just shut up and go on to the next exercise, but ... ;-)




  reply	other threads:[~2002-06-11  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-11  0:33 Disagreement between GNAT and Cohen? Andrew Hoddinott
2002-06-11  1:00 ` Robert A Duff
2002-06-11  7:23   ` Andrew Hoddinott [this message]
2002-06-13  1:52     ` Robert A Duff
2002-06-11  1:12 ` Preben Randhol
replies disabled

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