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,3a1c64628a09855b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Lack of formal syntax undermines Ada Date: Sat, 12 Apr 2008 16:02:30 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1208030550 12564 192.74.137.71 (12 Apr 2008 20:02:30 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 12 Apr 2008 20:02:30 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:m0fOkvlxObvvOnzivabwvuEDqC0= Xref: g2news1.google.com comp.lang.ada:20898 Date: 2008-04-12T16:02:30-04:00 List-Id: Gary Scott 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