comp.lang.ada
 help / color / mirror / Atom feed
* embed accept statement in procedures not possible?
@ 2007-05-04 15:04 Gerd
  2007-05-04 16:58 ` Jean-Pierre Rosen
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Gerd @ 2007-05-04 15:04 UTC (permalink / raw)


Hi all,

I work with GNAT 3.15 on Windows XP. My problem is that I want
structure my program in a way that is not accepted by GNAT, but I
cannot understand why.

My code (schematic only):

task t is
  entry e;
end t;

task body t is
  procedure p is
  begin
    accept e;
  end p;
begin
  p;
end t;

GNAT tells me: "enclosing body for accept must be a task". But - the
accept in procedure p _is_ in a task. So why is this not allowed?

My accept statement is a bit longer and needed a few times in
different situations. Therefore I don't want to "copy and paste" this
code directly in the task body.

Gerd




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-05-10 17:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-04 15:04 embed accept statement in procedures not possible? Gerd
2007-05-04 16:58 ` Jean-Pierre Rosen
2007-05-04 19:45   ` Adam Beneschan
2007-05-09  7:12     ` Jean-Pierre Rosen
2007-05-09 14:56       ` Adam Beneschan
2007-05-10 11:43         ` Jean-Pierre Rosen
2007-05-10 17:26           ` Pascal Obry
2007-05-04 17:03 ` (see below)
2007-05-04 21:22   ` adaworks
2007-05-05 23:54 ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox