comp.lang.ada
 help / color / mirror / Atom feed
From: David Sauvage <david.sauvage@adalabs.com>
Subject: Ada 2012 and type access to in out functions
Date: Tue, 11 Oct 2011 05:00:37 -0700 (PDT)
Date: 2011-10-11T05:00:37-07:00	[thread overview]
Message-ID: <43911dcc-5158-46c0-b8c3-505c5e0068eb@i14g2000yqg.googlegroups.com> (raw)

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;



             reply	other threads:[~2011-10-11 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 12:00 David Sauvage [this message]
2011-10-11 12:05 ` Ada 2012 and type access to in out functions AdaMagica
2011-10-11 12:10 ` Yannick Duchêne (Hibou57)
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