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: 103376,e9caf8720058dd5e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: embed accept statement in procedures not possible? Date: Fri, 04 May 2007 18:03:07 +0100 Message-ID: References: <1178291081.936739.131740@c35g2000hsg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net Sn1zK61Rs7j/JQa50LmY+wP5IxQtmusnPNqk0EN5gJ/syjJFdF User-Agent: Microsoft-Entourage/11.3.3.061214 Thread-Topic: embed accept statement in procedures not possible? Thread-Index: AceObhYAVGiGJPphEdu8oAARJIjQTg== Xref: g2news1.google.com comp.lang.ada:15530 Date: 2007-05-04T18:03:07+01:00 List-Id: On 4/5/07 16:04, in article 1178291081.936739.131740@c35g2000hsg.googlegroups.com, "Gerd" wrote: > 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? Because it is not legal Ada. See Ada (2005) Reference Manual Section 9.5.1, thus: > For an accept_statement, the innermost enclosing body shall be a task_body, IOW, the accept must not be in a body nested within the task body, it must be *immediately* within the task body. -- Bill Findlay chez blueyonder.co.uk