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!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Wed, 23 Apr 2014 18:42:55 +0200 Organization: A noiseless patient Spider Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <9f156351-e3d0-4d86-b816-1d5e09ee69da@googlegroups.com> <4e3a0e68-1514-4255-9c76-ef8758991ded@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 23 Apr 2014 16:42:53 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="271672a259e86d4645012299bd282e2a"; logging-data="19523"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e7RXhmWDBathN5v/wcjWW" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <4e3a0e68-1514-4255-9c76-ef8758991ded@googlegroups.com> Cancel-Lock: sha1:viHQWIVef5vjKdA6VDL+obveXPg= X-Enigmail-Version: 1.6 Xref: news.eternal-september.org comp.lang.ada:19534 Date: 2014-04-23T18:42:55+02:00 List-Id: Le 23/04/2014 18:31, björn lundin a écrit : > No. using the 'use' is certainly something one can have different opinions on. > But I like to avoid these kind of errors > > SET_ERROR_MODE(NO_ERROR, CRANE_TYPES.ASSIGNMENT_TIMEOUT, FALSE); > | > >>> error: "NO_ERROR" is not visible > >>> error: multiple use clauses cause hiding > >>> error: hidden declaration at crane_types.ads:113 > >>> error: hidden declaration at siemens_interface.ads:374 > >>> error: hidden declaration at core_types.ads:71 > > > One of the best thing with Ada05 was the approval of object.verb notation. > Even if i get to use it seldom at work, I do in hobby projects, > just for this reason. The variable/object knows where it belongs, > no need to use 'use' everywhere. > > This is the basic idea for my 'img proposal. > The variable knows its type. No need to > have long package names or risk hidden declarations. > > By the way, the above hidden situation was because of > adding a constant 'NO_ERROR' in siemens_interface.ads > > the other two was a constant and a coded value. > no hiding before that. I would tend to say that the "use" has the benefit to show you that you used the same name in various contexts with various meanings, and that a bit of reingeneering might be in order... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr