comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Lack of formal syntax undermines Ada
Date: Sat, 12 Apr 2008 16:02:30 -0400
Date: 2008-04-12T16:02:30-04:00	[thread overview]
Message-ID: <wccod8eon8p.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: b86Mj.2533$h75.509@newssvr27.news.prodigy.net

Gary Scott <garylscott@sbcglobal.net> writes:

> Sorry, non-Ada nube type question:  How is inter-language calling of
> functions that do allow inout and out arguments handled (say calling a C
> API)?

Well, C doesn't have anything like Ada's 'out' or 'in out'.

You can pass a pointer in C, and you can do the same in Ada:

    function F (X: access Integer) return Integer;
    pragma Import (C, F);

>...I assume the restriction only applies to intra-language calls.

No, that assumption is wrong.  An Ada function declaration cannot use
'out' or 'in out'.  That's true even if there's a pragma Import,
so the body of the function is in some other language.

If that other language supports something like Ada's 'in out',
well, too bad.  The compiler writer will have to invent
some other way to map that language onto what's allowed in Ada.

>...It
> seems like could create some messiness if the compiler always assumed
> only IN arguments in functions.

Yes, it is an annoying restriction (whether or not you're
interfacing to C).

- Bob



  parent reply	other threads:[~2008-04-12 20:02 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11  9:41 Lack of formal syntax undermines Ada usenet
2008-04-11 11:20 ` Peter C. Chapin
2008-04-15 12:57   ` usenet
2008-04-16  2:26     ` Peter C. Chapin
2008-04-16  3:14       ` Eric Hughes
2008-04-17  6:37     ` Randy Brukardt
2008-04-11 17:27 ` Georg Bauhaus
2008-04-11 18:13   ` Adam Beneschan
2008-04-11 21:25 ` John McCabe
2008-04-11 21:45   ` Robert A Duff
2008-04-11 22:37     ` John McCabe
2008-04-11 23:08       ` Adam Beneschan
2008-04-12  7:16         ` Dirk Craeynest
2008-04-14  7:23         ` Jean-Pierre Rosen
2008-04-12 12:57       ` Robert A Duff
2008-04-12 15:06         ` (see below)
2008-04-12 16:25           ` John McCabe
2008-04-12 17:55             ` (see below)
2008-04-12 22:19               ` John McCabe
2008-04-13  1:13                 ` (see below)
2008-04-13 11:51                   ` John McCabe
2008-04-13 14:13                     ` (see below)
2008-04-13 19:34                       ` John McCabe
2008-04-13 20:51                         ` (see below)
2008-04-13 21:06                           ` John McCabe
2008-04-12 17:16         ` Gary Scott
2008-04-12 18:43           ` Peter C. Chapin
2008-04-12 19:16             ` Gary Scott
2008-04-12 20:04               ` Robert A Duff
2008-04-12 23:32                 ` Gary Scott
2008-04-13  1:16                   ` Robert A Duff
2008-04-12 20:02           ` Robert A Duff [this message]
2008-04-12 20:52             ` Pascal Obry
2008-04-13 22:01       ` Florian Weimer
2008-04-13  9:46 ` anon
2008-04-15 13:22   ` usenet
2008-04-15 16:08     ` Adam Beneschan
2008-04-13 22:04 ` Florian Weimer
replies disabled

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