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 11:54:39 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <4c77317b-6d12-474f-928d-c713501f647a@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 10:54:39 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="c4b0a6e3ff80e5b2ad80b5846f49aee6"; logging-data="30931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uHJRDVc3F3vSsgvqCNH6GI9oQZjhhdig=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <4c77317b-6d12-474f-928d-c713501f647a@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:PapZXtNju4IV/ymNRZSpg8/Bpzs= Xref: reader02.eternal-september.org comp.lang.ada:49295 Date: 2017-12-01T11:54:39+01:00 List-Id: On 12/01/2017 12:28 AM, Mehdi Saada wrote: > I am a beginner, and curious... > How is used the "begin" clause in package bodies, usually ? Since package are libraries, I didn't think it could also behave like a procedure (or a task, since I assume it runs in parallel with the program calling it ?). > [begin > handled_sequence_of_statements] > end [[parent_unit_name.]identifier]; This is executed once, as the last thing during elaboration of the package, and provides for initialization that would not be otherwise possible. -- Jeff Carter "I'm a kike, a yid, a heebie, a hook nose! I'm Kosher, Mum! I'm a Red Sea pedestrian, and proud of it!" Monty Python's Life of Brian 77