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,e55245590c829bef 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!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Tue, 02 Nov 2010 00:17:53 +0100 Organization: Ada @ Home Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86bp695h4x.fsf@gareth.avalon.lan> <88guc6ll5hiauv1au07e323bgdq8ki9ep2@4ax.com> NNTP-Posting-Host: R3GxioSikq39nI4ipB4BLA.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 X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news1.google.com comp.lang.ada:15136 Date: 2010-11-02T00:17:53+01:00 List-Id: Le Mon, 01 Nov 2010 23:45:36 +0100, Brian Drummond = a =C3=A9crit: > Some people insist on never using "use" clauses, always qualifying = > names. I can > see their point but feel that's going a bit too far... I understand the point. However, to have =E2=80=9Cpackage IO renames Ada= .Text_IO;=E2=80=9D = and do some =E2=80=9CIO.New_Line;=E2=80=9D is not a nightmare too. There= is also = subprogram renaming, which allow to move frequently used subprograms to = be = referred to without any prefix. These are two alternatives to Use, not s= o = bad. To got further, you may add renaming at the top of a package, and y= ou = may, as an example, only add renaming for output subprograms. This show = = you what Ada.Text_IO is used for exactly. Tell there is a dependency to = a = package is nice, tell why (and what) is even more succulent. Some languages which also have packages, like Oberon and Modula-2, has = another pleasant way : you can selectively import without the need of = renaming. If you have a unit (the Pascal-heir's name for package) named = = Foo you can import Foo.Bar, Foo.That. I am not sure about the syntax, I = = forget too much, and I do not know if the compiler is required to return= = an error if ever Bar is overloaded in Foo. The difference with Ada, is = that you do not have to rewrite all the signature. This is a not so bad = = idea, as anyway, when you Use, the signatures are not recalled anywhere = = neither, so this is not more obscure than an import Foo.Bar. This has th= e = advantage of being more lightweight, and thus may appeal to use it more = = oftenly. -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.