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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ab3fadb7cac7363c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: using `use' : what is the best practice ? Date: Sun, 12 Jun 2011 07:19:52 +0200 Organization: Ada @ Home Message-ID: References: <57e75a35-058c-4172-9a3d-e11e7c5f7697@l2g2000prg.googlegroups.com> <03a8fa21-b515-41ea-bc65-b6ab85b0e88c@25g2000yqn.googlegroups.com> NNTP-Posting-Host: f5R0gSm2zBSnDCiIl1SGIw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.11 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19764 Date: 2011-06-12T07:19:52+02:00 List-Id: Le Wed, 08 Jun 2011 01:38:53 +0200, Shark8 a = = =C3=A9crit: > While this is true it can be handy for reducing prefix-clutter, > as could a rename. So, while you may be hesitant to use them on the > package, I find using them in declare-blocks and subprograms to be > quite readable and usable. > > With > Ada.Text_IO; > > Package Body Example is > [...] > Procedure Something_Interesting is > Use Ada.Text_IO; -- We're debugging here. > begin > [...] > Put_Line( "Debugging marker." ); > [...] > end Something_interesting; > End Example; That's a common idiom in Jean Pierre Rosen's source ;) > Ah, I like to use the comma-separated forms of use/with; this can be > helpful if you wish to do a quick commenting out of a use or with to > pass to the compiler and see if you really need it at all. > > EX: > With > Ada.Text_IO, > --Ada.Integer_IO, -- Am I even using Ada.Integer_IO? > --Ada.Tags, > --MY_PARSING_PACKAGE, > [...] > MY_CONSOLE_MANIPULATION_PACKAGE To talk again about him, you may also use his AdaDep tool for that purpo= se = ;) Have a look: http://www.adalog.fr/compo2.htm#adadep -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem] =E2=80=9Cc++; /* this makes c bigger but returns the old value */=E2=80=9D= [Anonymous]