comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Freezing query
Date: Thu, 30 Jan 2014 21:49:26 +0000
Date: 2014-01-30T21:49:26+00:00	[thread overview]
Message-ID: <lyppn92l95.fsf@pushface.org> (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


             reply	other threads:[~2014-01-30 21:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 21:49 Simon Wright [this message]
2014-01-30 23:23 ` Freezing query adambeneschan
2014-01-31  0:20   ` Simon Wright
2014-01-31 23:02     ` Randy Brukardt
replies disabled

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