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: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: begin clause in package bodies Date: Fri, 1 Dec 2017 17:29:16 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <4c77317b-6d12-474f-928d-c713501f647a@googlegroups.com> <7732b88c-5911-4857-a9c8-e5a719043b26@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 1 Dec 2017 16:29:16 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="bb7db6b7e5649449c49eca88698b05bb"; logging-data="9581"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+11SBFKVGrZjkLNlt01uMC+9LyMUwx7K0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <7732b88c-5911-4857-a9c8-e5a719043b26@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:rD9a0Nrw/A2/cjSQ2sIXB1xNXL4= Xref: reader02.eternal-september.org comp.lang.ada:49304 Date: 2017-12-01T17:29:16+01:00 List-Id: On 12/01/2017 02:05 PM, Mehdi Saada wrote: > Ok. But it has to be a limited practice right ? > I read using package with internal states or global variable was bad, regards to hiding implementation details, further development and concurrent programming. Less a problem Using a generic than can be instanced anywhere though. There's nothing wrong with a package with internal state. This is the standard implementation of a singleton object in Ada. If the package is not task safe, that should be noted clearly in the package spec. It's also possible for such packages to be task safe. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17