comp.lang.ada
 help / color / mirror / Atom feed
From: Jerrid Kimball <jerrid@kimball.co>
Subject: Re: bindings with Ada 2012 aspects
Date: Fri, 27 Apr 2012 15:23:13 -0500
Date: 2012-04-27T15:23:13-05:00	[thread overview]
Message-ID: <jnev7l$7kk$1@munin.nbi.dk> (raw)
In-Reply-To: <jna9f5$tn1$1@munin.nbi.dk>



On 04/25/2012 08:47 PM, Randy Brukardt wrote:
> "Jerrid Kimball"<jerrid@kimball.co>  wrote in message
> news:jn7egd$scs$1@munin.nbi.dk...
> ....
>> As I see it, a pragma Export should be directly replaceable by interfacing
>> aspects' aspect marks and definitions:
>>
>> procedure Wait renames PO.Wait;
>> pragma Export (C, Wait, "wait");
>>
>> becomes:
>>
>> procedure Wait renames PO.Wait
>>     with Export =>  True, Convention =>  C, Link_Name =>  "wait";
>>
>> Am I looking at what should be submitted to ACT as a bug?
>
> I believe this replacement is correct, except for one tiny detail:
>
> 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 think in this particular case, you are trying to create a wrapper with
> this renames (as opposed to "just" another view of the original subprogram).
> I think that allowing the original pragma is dubious (although an
> implementation is allowed to support Import and Export on anything they
> like -- but it certainly is *not* portable).

Thanks for that.  I hadn't considered that it would be unportable. 
Frankly, I haven't read where pragma Export is actually valid, but shall 
do so now.

>
> So, I think you need to replace this subprogram renames by a real subprogram
> (one that calls PO.Wait in it's body), and I suspect if you do that you'll
> have no problems with the aspects.

You may expect this, but the problem remains.  I failed to include my 
other testing in my original post; it fails no matter what.  I'll 
attempt on a newer wavefront as I can and update if I remember.

>
>                               Randy Brukardt, Editor, ISO/IEC 8652:tdb. :-)
>
>
>
>
>



  reply	other threads:[~2012-04-27 20:23 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 [this message]
2012-05-02 12:38   ` Natasha Kerensikova
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