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,7ae84c67e252c8f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-24 21:28:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!usc.edu!attla2!ip.att.net!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: "SteveD" Newsgroups: comp.lang.ada References: <3D3F58F4.9050305@hotmail.com> Subject: Re: Naming conventions X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1027571306 12.225.227.101 (Thu, 25 Jul 2002 04:28:26 GMT) NNTP-Posting-Date: Thu, 25 Jul 2002 04:28:26 GMT Organization: AT&T Broadband Date: Thu, 25 Jul 2002 04:28:26 GMT Xref: archiver1.google.com comp.lang.ada:27390 Date: 2002-07-25T04:28:26+00:00 List-Id: "Ryan Tarpine" wrote in message news:3D3F58F4.9050305@hotmail.com... > Coming from C++, what I used to think of as a class (a type and its > associated methods) is now roughly equivalent to a package.... A package is closer to a C++ namespace than a class. A C++ class corresponds roughly to an Ada tagged type with its associated procedures and functions. > Whenever I try to name a package, I use what I normally think of as the type > itself. For example, I would put a vector type in a package Vector or a > regular expression type in a package Regular_Expression. However, once > I name the package, I am at a loss for what to call the data type inside. > > I've been appending '_Type' to the package names, making names like > Vector_Type, but I don't think that is the Right Thing(TM). I've been > skimming the style guides (which I heartily recommend all newbies to > do), and I've seen a little bit of calling the type simply Instance or > Object. When used with the package name this looks nice, such as > Vector.Instance. What do the Ada gurus normally do for this? :) If you want to follow this sort of convention, perhaps you should use: package Vector_Package is type Vector_Type is abstract tagged null record with private; ... etc. I'm sure you'll get all kinds of feedback that this convention is bad, but if you're consistant and make things readable it really doesn't matter what conventions you follow. SteveD