comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Generics and Child Packages
Date: Mon, 12 Aug 2013 15:27:34 -0500
Date: 2013-08-12T15:27:34-05:00	[thread overview]
Message-ID: <kubgfp$lb9$1@loke.gir.dk> (raw)
In-Reply-To: 79ec97f1-b5f8-4b12-b351-262fad685f50@googlegroups.com

<sbelmont700@gmail.com> wrote in message 
news:79ec97f1-b5f8-4b12-b351-262fad685f50@googlegroups.com...
...
>Though I still don't buy the "children of a generic are a generic" 
>explanation.

The original rule was "generic units cannot have children". I still think 
that was the better rule. :-)

Very late in the Ada 9x design process, child generics were added with the 
compromise that they would have to require explicit instantiations. 
Otherwise, we'd need to generate implicit instantiations somehow, and that 
would be a very new and complex concept in Ada. Unfortunately, there are a 
lot of problems with the current semantics as well (because withing a child 
of a generic causes an instance of a parent to "sprout" (in the terms of 
Steve Baird) a bunch of additional declarations, and that can cause all 
kinds of wacky conflicts). Those problems would have been multiplied by 10 
if we had allowed implicit instantiations (because of the much larger number 
of implicit declarations).

The whole idea of child units of generics is fatally flawed in my view. It 
just doesn't work semantically.

                                  Randy.




  parent reply	other threads:[~2013-08-12 20:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 20:35 Generics and Child Packages sbelmont700
2013-08-10  9:25 ` AdaMagica
2013-08-10 15:39 ` Felix Krause
2013-08-11 15:49 ` sbelmont700
2013-08-11 16:51   ` Robert A Duff
2013-08-11 18:30   ` AdaMagica
2013-08-11 19:20   ` Shark8
2013-08-12 20:27   ` Randy Brukardt [this message]
2013-08-12 21:58     ` Simon Wright
2013-08-12 20:19 ` 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