comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Ada 2012 and type access to in out functions
Date: Tue, 11 Oct 2011 14:10:31 +0200
Date: 2011-10-11T14:10:31+02:00	[thread overview]
Message-ID: <op.v26r3ty3ule2fv@index.ici> (raw)
In-Reply-To: 43911dcc-5158-46c0-b8c3-505c5e0068eb@i14g2000yqg.googlegroups.com

Le Tue, 11 Oct 2011 14:00:37 +0200, David Sauvage  
<david.sauvage@adalabs.com> a écrit:

> 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.

-- 
“Syntactic sugar causes cancer of the semi-colons.”  [Epigrams on  
Programming — Alan J. — P. Yale University]
“Structured Programming supports the law of the excluded muddle.” [Idem]
Java: Write once, Never revisit



  parent reply	other threads:[~2011-10-11 12:10 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) [this message]
2011-10-11 17:38   ` Adam Beneschan
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