"Natasha Kerensikova" <
lithi...@gmail.com> wrote in message
news:slrnjq2ake.1l...@sigil.instinctive.eu...
...
> What is so special about "just [introducing] another view" that cannot
> be achieved by the more direct code below?
>
> procedure Bar is new Generic_Bar (Type_1, Do_Real_Stuff);
This is a "renames-as-body", and it causes problems because you might have
conflicts between the aspects that are defined (explicitly or implicity) for
the specification, and those that are defined for the instance by the
generic definition. Other kinds of renames-as-body have fewer problems with
this.
You're *never* allowed to specify language-defined aspects on a body (of any
kind) [which is more about the original topic than your question].
In this specific case of Janus/Ada, the actual call profile of a generic
instantiation is different than the call profile of a non-generic subprogram
with the same set of parameters. So to make this work, there has to be a
wrapper or some other "connector" generated. Other implementations also have
various issues with this.
This is a lots of work, and it was never felt that this was common enough
that allowing it would make any real difference. That's because the vast
majority of generic units are packages, and this would do nothing to help
for a generic package instantiation. Maybe that judgement was wrong; but
even if the language was changed this would be low priority to change in
Janus/Ada simply because it would be a lot of work, and there are many other
projects which would have more benefit to our customers than this one.
It should be noted that this was decided during Ada 95, and it never has
been revisited since (to my knowledge), so perhaps it would make some sense
to revisit this for Ada 2020.
Randy.