comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: bindings with Ada 2012 aspects
Date: Wed, 2 May 2012 19:10:15 -0500
Date: 2012-05-02T19:10:15-05:00	[thread overview]
Message-ID: <jnsida$k6$1@munin.nbi.dk> (raw)
In-Reply-To: slrnjq2ake.1lme.lithiumcat@sigil.instinctive.eu

"Natasha Kerensikova" <lithiumcat@gmail.com> wrote in message 
news:slrnjq2ake.1lme.lithiumcat@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.





      reply	other threads:[~2012-05-03  0:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 23:54 bindings with Ada 2012 aspects Jerrid Kimball
2012-04-25  7:43 ` Martin
2012-04-25 12:09 ` Stephen Leake
2012-04-25 14:25   ` Jerrid Kimball
2012-04-26  1:47 ` Randy Brukardt
2012-04-27 20:23   ` Jerrid Kimball
2012-05-02 12:38   ` Natasha Kerensikova
2012-05-03  0:10     ` Randy Brukardt [this message]
replies disabled

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