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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7eaf9f2597de2259 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-08 12:46:37 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.media.kyoto-u.ac.jp!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!not-for-mail Message-ID: <3BC20291.6F3D@li.net> From: Vincent Marciante X-Mailer: Mozilla 3.0 (OS/2; I) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: on package naming, should the word "_pkg" be part of it? References: <9pif1o01btl@drn.newsguy.com> <3BBD12F1.9BED0B70@acm.org> <3BC0B1D4.21C79A8@acm.org> <3BC1D74F.3254@li.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 08 Oct 2001 15:46:25 -0400 NNTP-Posting-Host: 168.191.55.28 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 1002570396 168.191.55.28 (Mon, 08 Oct 2001 19:46:36 GMT) NNTP-Posting-Date: Mon, 08 Oct 2001 19:46:36 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:13964 Date: 2001-10-08T15:46:25-04:00 List-Id: Stephen Leake wrote: > > Vincent Marciante writes: > > > > > > > > If you declare the type in another package then you do not > > have to add any "noise" to the simple type name. > > True. But I'm mostly thinking of parameters for primitive operations > on a type (see below). The above is just the simplest example that > shows the Ada limitation (merged object and type namespace). > > > A better example would be: > > package Cars is > > type Car_Type is ...; > > procedure Foo (Car : in Car_Type); > > procedure Bar (Car : in Car_Type); > > end package Cars; > > You can come up with alternatives to any individual use of _Type. But > in my experience, _Type is the only alternative that works in _all_ > situations; generic instantiations in particular get very fussy about > names. > > -- > -- Stephe I do not know the situation that gives trouble with generic instantiation. The following is legal. What is the problematic situation? generic type Car is private; package Cars is procedure Foo (Car : in Cars.Car); procedure Bar (Car : in Cars.Car); end Cars; package body Cars is procedure Foo (Car : in Cars.Car) is begin null; end; procedure Bar (Car : in Cars.Car) is begin null; end; end Cars; with cars; procedure cars_test is type car is new boolean; package cars is new standard.cars(car); car_1 : car; car_2 : car; begin cars.foo(car_1); cars.bar(car_2); end cars_test;