From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f57aba5273502edf X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.227.230 with SMTP id sd6mr1981348pbc.8.1335339886320; Wed, 25 Apr 2012 00:44:46 -0700 (PDT) Path: r9ni96074pbh.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: bindings with Ada 2012 aspects Date: Wed, 25 Apr 2012 00:43:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2094922.2824.1335339787925.JavaMail.geo-discussion-forums@vbx14> References: NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 X-Trace: posting.google.com 1335339886 12651 127.0.0.1 (25 Apr 2012 07:44:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 25 Apr 2012 07:44:46 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-25T00:43:07-07:00 List-Id: 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