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!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: package body Date: Tue, 07 Oct 2014 21:05:58 +0100 Organization: A noiseless patient Spider Message-ID: References: <7c811e73-61e2-4c89-abb3-749d31461758@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="865ecc8333c04b7dc8d5f87fc772110b"; logging-data="1712"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tinFSXUDuE6sfs7pck/m7Ffc0B1WoRyU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:jI8/7qsmRE26o5fr6bXMiOuTqmw= sha1:+Luw8ytK0fllLWQHkCveYgNnAFM= Xref: news.eternal-september.org comp.lang.ada:22195 Date: 2014-10-07T21:05:58+01:00 List-Id: Stribor40 writes: > I have following.... > > package spec file > package body which contains one function and one procedure and one > global variable I would call this variable package-local, since nothing outside the package body can see it. > I would like to access this global variable(with its data) from client > file. What is a "client file"? Is it another Ada package/subprogram? > Is there anything wrong with doing g it this way and if there is > better way to do this? Unless I've misunderstood you, you *can't* do it this way. I suppose you could put the variable in the (public part of) the package spec. You might alternatively provide accessor operations; that way you could control/validate accesses and only let the "clients" see the data you want them to.