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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,56cff81b925fb65b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Ada 2012 and type access to in out functions Date: Tue, 11 Oct 2011 14:10:31 +0200 Organization: Ada @ Home Message-ID: References: <43911dcc-5158-46c0-b8c3-505c5e0068eb@i14g2000yqg.googlegroups.com> NNTP-Posting-Host: ptUMrMjC97t396y1m7oz6Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.51 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:22338 Date: 2011-10-11T14:10:31+02:00 List-Id: Le Tue, 11 Oct 2011 14:00:37 +0200, David Sauvage = a =C3=A9crit: > Using GNAT GPL 2011, I try to define a type that is an access to an in= > out function, and the following example code [1] is illegal for the > compiler. > > Is it an Ada 2012 restriction on using in out functions, a GNAT GPL > 2011 limitation or a bug ? > > Cheers, > > [1] > -- gnatmake -gnat12 in_out_function_access_type.adb > procedure In_Out_Function_Access_Type is > > function Validate (Status : in out Boolean) return String > is > begin > Status :=3D True; > return "command"; > end Validate; > > type Callback is access function (Status : in out Boolean) return > String; > -- illegal functions can only have "in" parameters. > -- build successfully if the above line is commented > begin > null; > end In_Out_Function_Access_Type; Possibly not already implemented in GNAT 2011 so. Sorry, can't test right now, as I don't have my Ada 2012 compiler (GNAT = = too), on hand. I just can tell you in/out parameters for functions are = valid Ada 2012. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem] Java: Write once, Never revisit