comp.lang.ada
 help / color / mirror / Atom feed
* Freezing query
@ 2014-01-30 21:49 Simon Wright
  2014-01-30 23:23 ` adambeneschan
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2014-01-30 21:49 UTC (permalink / raw)


A question[1] on StackOverflow thinks that given

   type U is tagged private;
   type W is new U with private;
   type X is new W with private;

   procedure M1 (P1 : U; P2 : in out U; P3 : Integer);
   procedure M2 (P1 : Float ; P2 : in out U);
   procedure M2 (P1 : Float ; P2 : Boolean ; P3 : in out W);

the three operations are primitive.

GNAT doesn't treat them as primitive unless you re-order so that the
subprograms come immediately after the type concerned:

   type U is tagged private;
   procedure M1 (P1 : U; P2 : in out U; P3 : Integer);
   procedure M2 (P1 : Float ; P2 : in out U);

   type W is new U with private;
   procedure M2 (P1 : Float ; P2 : Boolean ; P3 : in out W);

   type X is new W with private;

This seems reasonable given ARM 13.14(7)[2], but then AARM 13.14(7.b)[3]
says that "The declaration of a private extension does not cause
freezing.".

You'd have thought that (7.b) ought not to be relegated to the Annotated
manual!

Is GNAT's behaviour a bug?

[1]
http://stackoverflow.com/questions/21447636/ada-derived-types-and-primitive-operation
[2] http://www.ada-auth.org/standards/12rm/html/RM-13-14.html#p7
[3] http://www.ada-auth.org/standards/12aarm/html/AA-13-14.html#p7.b


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

end of thread, other threads:[~2014-01-31 23:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 21:49 Freezing query Simon Wright
2014-01-30 23:23 ` adambeneschan
2014-01-31  0:20   ` Simon Wright
2014-01-31 23:02     ` Randy Brukardt

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