From: Adam Beneschan <adam@irvine.com>
Subject: Re: Ada 2012 and type access to in out functions
Date: Tue, 11 Oct 2011 10:38:33 -0700 (PDT)
Date: 2011-10-11T10:38:33-07:00 [thread overview]
Message-ID: <5fbb4706-c32f-495f-bcc3-831ff6c1fcab@o35g2000prn.googlegroups.com> (raw)
In-Reply-To: op.v26r3ty3ule2fv@index.ici
On Oct 11, 5:10 am, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> 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
>
> > function Validate (Status : in out Boolean) return String
> > is
> > begin
> > Status := 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.
Out of curiosity, what exactly were you thinking of
testing? :) :) :) And what question would it have answered?
-- Adam
next prev parent reply other threads:[~2011-10-11 17:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 12:00 Ada 2012 and type access to in out functions David Sauvage
2011-10-11 12:05 ` AdaMagica
2011-10-11 12:10 ` Yannick Duchêne (Hibou57)
2011-10-11 17:38 ` Adam Beneschan [this message]
2011-10-11 19:32 ` Yannick Duchêne (Hibou57)
2011-10-12 10:25 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox