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: a07f3367d7,56cff81b925fb65b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!o35g2000prn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada 2012 and type access to in out functions Date: Tue, 11 Oct 2011 10:38:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5fbb4706-c32f-495f-bcc3-831ff6c1fcab@o35g2000prn.googlegroups.com> References: <43911dcc-5158-46c0-b8c3-505c5e0068eb@i14g2000yqg.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1318356414 1817 127.0.0.1 (11 Oct 2011 18:06:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 11 Oct 2011 18:06:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o35g2000prn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:22344 Date: 2011-10-11T10:38:33-07:00 List-Id: On Oct 11, 5:10=A0am, Yannick Duch=EAne (Hibou57) wrote: > > 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 > > > =A0 =A0function Validate (Status : in out Boolean) return String > > =A0 =A0is > > =A0 =A0begin > > =A0 =A0 =A0 Status :=3D True; > > =A0 =A0 =A0 return "command"; > > =A0 =A0end Validate; > > > =A0 =A0type Callback is access function (Status : in out Boolean) retur= n > > String; > > =A0 =A0-- illegal =A0functions can only have "in" parameters. > > =A0 =A0-- build successfully if the above line is commented > > begin > > =A0 =A0null; > > 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 = =A0 > too), on hand. I just can tell you in/out parameters for functions are = =A0 > valid Ada 2012. Out of curiosity, what exactly were you thinking of testing? :) :) :) And what question would it have answered? -- Adam