comp.lang.ada
 help / color / mirror / Atom feed
* GNAT GPL, generics
@ 2005-10-02  9:15 Dmitry A. Kazakov
  2005-10-02  9:24 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-02  9:15 UTC (permalink / raw)


It seems that in GNAT GPL generics are even more buggy than they were in
3.15p. The most interesting new "feature" is that you can have spec. and
body compiled and yet get errors in them upon instantiation, just like in
C++ templates! Another is that declarations in formal packages of a generic
child can somewhat hide (without being "use"-ed!) declarations of the
parent. It is almost impossible to use parameters of parameters:

generic
   with package A (<>);
   with package B (A.Something);
package C is

It will be a total mess in the children of C.

Does anybody have experience with?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: GNAT GPL, generics
  2005-10-02  9:15 GNAT GPL, generics Dmitry A. Kazakov
@ 2005-10-02  9:24 ` Dmitry A. Kazakov
  2005-10-02 10:06 ` Dmitry A. Kazakov
  2005-10-03  8:36 ` Alex R. Mosteo
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-02  9:24 UTC (permalink / raw)


On Sun, 2 Oct 2005 11:15:08 +0200, Dmitry A. Kazakov wrote:

> generic
>    with package A (<>);
>    with package B (A.Something);
> package C is

I mean:

generic
   with package AA is new A (<>);
   with package BB is new (AA.Something);
package C is

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: GNAT GPL, generics
  2005-10-02  9:15 GNAT GPL, generics Dmitry A. Kazakov
  2005-10-02  9:24 ` Dmitry A. Kazakov
@ 2005-10-02 10:06 ` Dmitry A. Kazakov
  2005-10-03  8:36 ` Alex R. Mosteo
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2005-10-02 10:06 UTC (permalink / raw)


Here is one reduced example:

generic
   type T is digits <>;
package A is
end A;
-----------------------------
with A;
generic
   with package AA is new A (<>);
package B is
end B;
----------------------------
with B;
generic
   with package BB is new B (<>);
package C is
   X : BB.AA.T; -- This is OK
end C;
-------------------------------------------------------
Now add E:
-----------------------------
with A;
generic
   with package AA is new A (<>);
package E is
end E;
--------------------------
with B, E;
generic
   with package BB is new B (<>);
   with package EE is new E (BB.AA);
package D is
   X : BB.AA.T; -- "T" is not a visible entity of "AA"
end D;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: GNAT GPL, generics
  2005-10-02  9:15 GNAT GPL, generics Dmitry A. Kazakov
  2005-10-02  9:24 ` Dmitry A. Kazakov
  2005-10-02 10:06 ` Dmitry A. Kazakov
@ 2005-10-03  8:36 ` Alex R. Mosteo
  2 siblings, 0 replies; 4+ messages in thread
From: Alex R. Mosteo @ 2005-10-03  8:36 UTC (permalink / raw)


Dmitry A. Kazakov wrote:
> It seems that in GNAT GPL generics are even more buggy than they were in
> 3.15p. The most interesting new "feature" is that you can have spec. and
> body compiled and yet get errors in them upon instantiation, just like in
> C++ templates! 

This isn't specially new, albeit I don't know if it is more frequent. I 
had an experience like this with 3.15p IIRC. Fortunately it was quite 
rare, it's the only time I've seen it.



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

end of thread, other threads:[~2005-10-03  8:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-02  9:15 GNAT GPL, generics Dmitry A. Kazakov
2005-10-02  9:24 ` Dmitry A. Kazakov
2005-10-02 10:06 ` Dmitry A. Kazakov
2005-10-03  8:36 ` Alex R. Mosteo

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