comp.lang.ada
 help / color / mirror / Atom feed
From: Martin <martin@thedowies.com>
Subject: Re: bindings with Ada 2012 aspects
Date: Wed, 25 Apr 2012 00:43:07 -0700 (PDT)
Date: 2012-04-25T00:43:07-07:00	[thread overview]
Message-ID: <2094922.2824.1335339787925.JavaMail.geo-discussion-forums@vbx14> (raw)
In-Reply-To: <jn7egd$scs$1@munin.nbi.dk>

On Wednesday, April 25, 2012 12:54:50 AM UTC+1, Jerrid Kimball wrote:
> Hello!  Long time reader, first time poster.
> 
> Before I get started, remember that there is a friendly channel on 
> Freenode IRC network dedicated to dicussing Ada and creating a general 
> sense of community around the language.  The channel population (around 
> 60) would profit by any additional great conversation or insights that 
> can be brought about.  Thanks!
> 
> In my spare time I've been tinkering with Ada 2012 and just happened to 
> be working on making a C main play nicely with Ada tasking.  Anyway, 
> long story short, I came to wanting to export some Ada subprograms for 
> the C main to use, but I'm finding that either the appropriate aspects 
> are broken in GNAT Pro 7.1w or my understanding of the new syntax is flawed.
> 
> 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?
> 
> Jerrid Kimball

I've run into 1 'feature' with aspects in GNAT 7.1, which is you can't currently mix them with expression functions.

Ada2012 support is still 'in progress'...but still very useable as is for the most part.

I'm loving the new "for .. of" iterator support - much cleaner code!

Also, expression functions are useful in that I can now leave the package body for subprograms that manipulate state, i.e. actually *do* stuff! Keeps them smaller and should therefore help in understanding as you can see more on one screen at a time.

I've adopted a certain style with expression functions though which is to place them right at the end of the private section of the package spec - after everything else. This keeps the public view free from implementation detail as possible.

-- Martin



  reply	other threads:[~2012-04-25  7:44 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 [this message]
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
replies disabled

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