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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: some trivial questions? Date: Thu, 2 Nov 2017 09:27:45 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <6a5368c5-f015-4dcb-9291-e77b40fa1bf1@googlegroups.com> NNTP-Posting-Host: lKHBldubgAWx1EqbQpQ5LQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:48698 Date: 2017-11-02T09:27:45+01:00 List-Id: On 02/11/2017 02:19, tclwarrior@gmail.com wrote: > i think every time you insert a use, you will most definitely add a > with> it just look to me, that this is a bit redundant to add two > line, when one should do ... the compiler can should easily assume > that Yes. There is no reason why "with" could not be deduced from "use". E.g. it is no problem to move with out of the local scope: declare use Bar; -- Cannot have with Bar here, but who cares? begin ... There is no problem to determine if "use" refers to a local package like: declare package Foo is new Boo; use Foo; -- Cannot with Foo, but again who cares? begin It is historically so and also there is a great unjustified sentiment against "use" in Ada community. I have a theory that people are either lazy to design their package in a way to make it friendly for "use" or take too big dosages of generics (:-)). Ada generics are totally "use" unfriendly. > i think in a program with a large import (use) list of libraries, this can > save many lines and looks cleaner This is rather a different issue. "Use" is not transitive. If you "use A" in B and then "use B" in C that does not make "use A" in C. In a great number of cases one would like to have transitive "use". In many other cases one would like to have it as it is. This is a long-standing problem of having to reusable "package interfaces". -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de