From: Natasha Kerensikova <lithiumcat@gmail.com>
Subject: Re: bindings with Ada 2012 aspects
Date: Wed, 2 May 2012 12:38:05 +0000 (UTC)
Date: 2012-05-02T12:38:05+00:00 [thread overview]
Message-ID: <slrnjq2ake.1lme.lithiumcat@sigil.instinctive.eu> (raw)
In-Reply-To: jna9f5$tn1$1@munin.nbi.dk
Hello,
On 2012-04-26, Randy Brukardt <randy@rrsoftware.com> wrote:
> No language-defined aspects are allowed on renames, and the above is a
> renames.
>
> The reason is that almost all language-defined aspects are the same for all
> views of an entity, and a rename just introduces another view. Moreover,
> this renames "trick" exists for pragmas simply to get around the limitations
> of pragmas for overloaded entities, something that is totally unnecessary
> for aspects.
I'm sorry to derail this thread a bit, but this interesting description
of renames makes we wonder even more why they are needed for public
subprograms implemented by generic instantiation. Like the following:
package Foo;
procedure Bar (Arg_1 : in out Type_1; Arg_2 : in Type_2);
end Foo;
package body Foo
generic
type Formal_Type;
with procedure Do_Stuff (Arg_2 : in Type_2);
procedure Generic_Bar (Arg_1 : in out Formal_Type; Arg_2 : in Type_2);
procedure Bar_Instance is new Generic_Bar (Type_1, Do_Real_Stuff);
procedure Bar (Arg_1 : in out Type_1; Arg_2 : in Type_2)
renames Bar_Instance;
end Foo;
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);
Thanks for your insights,
Natasha
next prev parent reply other threads:[~2012-05-02 12:38 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 [this message]
2012-05-03 0:10 ` 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