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!feeder.eternal-september.org!aioe.org!.POSTED.8dY8omnix++EB5/QBRk4Sw.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: decomposing large packages Date: Thu, 09 Jan 2020 17:43:40 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <3ab1342f-a6d5-42ce-8bb0-1b49d3fd5e42@googlegroups.com> NNTP-Posting-Host: 8dY8omnix++EB5/QBRk4Sw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) Cancel-Lock: sha1:hNUKsaJZTRVnaSVX2nYIlJ79aXw= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:57811 Date: 2020-01-09T17:43:40+00:00 List-Id: mario.blunk.gplus@gmail.com writes: >> P's body can see P.S1: >> >> package P.S1 is >> procedure N (Value : Thing) is null; -- save typing :-) >> end P.S1; >> >> with P.S1; >> package body P is >> procedure M (Value : Thing) is >> begin >> S1.N (Value); >> end M; >> end P; > > Thanks Simon, but the body of P can't see the specification of S1. Oh yes it can. Full test program: package P is type Thing is new Integer; procedure M (Value : Thing); end P; with P.S1; package body P is procedure M (Value : Thing) is begin S1.N (Value); end M; end P; with Ada.Text_IO; package P.S1 is procedure N (Value : Thing); end P.S1; package body P.S1 is procedure N (Value : Thing) is begin Ada.Text_IO.Put_Line ("P.S1.N called with " & Value'Img); end N; end P.S1; with P; procedure Test is begin P.M (42); end Test; =============== $ gnatmake test -f gcc -c test.adb gcc -c p.adb gcc -c p-s1.adb gnatbind -x test.ali gnatlink test.ali gnatlink: warning: executable name "test" may conflict with shell command $ ./test P.S1.N called with 42