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 11:59:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: on package naming, should the word "_pkg" be part of it? Date: 08 Oct 2001 14:50:46 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <9pif1o01btl@drn.newsguy.com> <3BBD12F1.9BED0B70@acm.org> <3BC0B1D4.21C79A8@acm.org> <3BC1D74F.3254@li.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1002567153 26165 128.183.220.71 (8 Oct 2001 18:52:33 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 8 Oct 2001 18:52:33 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:13955 Date: 2001-10-08T18:52:33+00:00 List-Id: Vincent Marciante writes: > > > > type Car is record ... end record; > > > > Car : Car; > > > > This is natural, but illegal. The easiest (for _me_, not for > > everyone!) way to resolve it is to add some "noise" to either the > > object or the type. Since the object name will appear more often than > > the type, I add noise to the type: > > > > type Car_Type is record ... end record; > > > > Car : Car_Type; > > 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). > By the way, your argument above implies that you are expecting to > any have one object of the type. In my experience, It is rare to > have only one object of a type - I would not add _type to all type > definitions as a convention just to make the rare case "easy" to > deal with. 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