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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: body stub not allowed in inner scope Date: Wed, 28 Feb 2018 18:05:53 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="9acd79c717178406523000b4307bfa71"; logging-data="15902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+F5XPDwKfzMzDWnwc0MVD+RCJp+17ECM4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:nydggQzwMkWAYx29lHCz3xP8zek= sha1:JTJ3XejZ1JdjXuApN0655gjakyo= Xref: reader02.eternal-september.org comp.lang.ada:50718 Date: 2018-02-28T18:05:53+00:00 List-Id: "Jeffrey R. Carter" writes: > On 02/28/2018 02:01 PM, Mehdi Saada wrote: >> I find that rule very limitating ! >> I need the procedures to know the context (access local variable). >> Same with nested packages: >> I need them to access local variable too, and be able to exit an >> enclosing loop. Though I'm not sure it's allowed either. >> Without stuff like this, my working memory is already overflowed >> with a hundred lines. > > How do you write the separate body? Remember, you have to be able to handle > > package body P is > procedure Q is > procedure R is separate; > begin -- Q > R; > end Q; > > procedure Q (I : Integer) is > procedure R is separate; > begin -- Q > R; > end q; > end P; GNAT couldn't handle that even if it was the Qs that were separate.