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!news4.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: _Type vs no _Type Date: Sat, 06 Nov 2010 23:12:02 +0100 Organization: Ada @ Home Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <82lj5c5ecm.fsf@stephe-leake.org> <82zktq4n9b.fsf_-_@stephe-leake.org> <7cc5dde2-8052-408c-b77f-8bf081d53cde@r14g2000yqa.googlegroups.com> <35c754f6-c38e-40b2-a600-4c7bebb3559d@e20g2000vbn.googlegroups.com> NNTP-Posting-Host: w00cPq0BvzOlRCSRJJEoeQ.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:15354 Date: 2010-11-06T23:12:02+01:00 List-Id: Le Sat, 06 Nov 2010 22:20:19 +0100, Shark8 a = = =C3=A9crit: > Being relatively new to Ada, I didn't know about "use type" when I ran= > into the problem and used dot-qualification instead of the [otherwise-= > needed] "use". In few words, this is a useful feature to Use all operations of a type = without requiring to Use the whole package where it is defined and witho= ut = (like this would be if you wanted to avoid to Use the whole package) to = = import these operations via renames clause. if package A defines a type and some operations, if you want to invok = these operation with using a prefix notation of many renames clause, the= = you can do a =E2=80=9Cuse type=E2=80=9D. This is especially useful with predefined operators like =E2=80=9C+=E2=80= =9D, =E2=80=9C-=E2=80=9D, when = this way you can get ride of all of these =E2=80=9CMy_Package."+"(Left =3D= > = Expression_1, Right =3D> Expression_2)=E2=80=9D For more details, see (Ada 2005): http://www.adaic.org/standards/05rm/html/RM-8-4.html But as this did not solved everything, ex. you still have to use a prefi= x = to refer to enumeration items as an example, the =E2=80=9Cuse type=E2=80= =9D has been = extended in Ada 2012, with a =E2=80=9Cuse all type=E2=80=9D, which impor= t every thing of a = type, no more restricted to its operations. For more details, see (Ada 2012): http://www.ada-auth.org/standards/12rm/html/RM-8-4.html And also if you are inquisitive: http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0150-1.txt?rev=3D1= .8 > There have been complaints that a use type clause does not make > enough things visible (e.g. enumeration literals, classwide operations= > for tagged types), whereas a use_package_clause makes too much visible= . > Something in between is wanted. By the way: do someone know why the Ada LRM 2012 has moved from AdaIC to= = Ada-Auth ? -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9CI am fluent in ASCII=E2=80=9D [Warren 2010]