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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: body stub not allowed in inner scope Date: Sat, 3 Mar 2018 10:42:27 +0100 Organization: A noiseless patient Spider Message-ID: References: <55cd79f5-4b37-4b08-b292-073ed2f37021@googlegroups.com> <15c49c4e-726a-4fd7-bf35-c7d27ff9a491@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 3 Mar 2018 09:42:28 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b21aa820ac55680f6d17f93e72a20d9b"; logging-data="23780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198OqllHwrliI5lT6VstZIZtS/yNlEiPWE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 In-Reply-To: Content-Language: de-DE Cancel-Lock: sha1:tCVwUz3VnHrRqdpDbvDni5QmiMk= Xref: reader02.eternal-september.org comp.lang.ada:50807 Date: 2018-03-03T10:42:27+01:00 List-Id: On 02.03.18 20:47, Simon Wright wrote: > G. B. writes: > >> Randy Brukardt wrote: >>> why put them in a separate file in the first place? >> >> Yes, separate units can be placed after the bodies, >> yet in the same file! Not always my choice but that, too >> moves dependences out of the superunit. >> Irrespective of what a compiler can make of this. > > This seems a really crazy approach. > > Given that Emacs, for example, is quite capable of displaying two > view of different parts of the same buffer. Emacs, or any other plain text editor, has no influence on the semantics of Ada unit dependencies, as that's a matter of structuring source text. I'd like an Ada compiler to diagnose that a dependency can be moved to a subunit refactored from some coherent part of a body, say. GNAT does this for with-clauses that can be moved to the body. -- -*- page-delimiter: "^\\(package\\|separate\\)" -*- package body P is procedure P1; procedure P2; procedure P3; procedure P4; X : T; procedure P1 is null; procedure P2 is null; procedure P3 is null; procedure P4 is separate; end P; with Subsystem.Load; separate (P) procedure P4 is use Subsystem; begin if Whatever (X) then X.Op_15; Load.Get_Going (X); end if; end P4;