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,faf469c89f73f91d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-22 11:24:02 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Package Instances??? Date: Fri, 22 Feb 2002 13:10:36 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <721b6d80.0202131302.1ccce2ed@posting.google.com> <3C6BFAFC.7060902@mail.com> <3C73F5F6.7050704@mail.com> <3C7487D6.5060603@mail.com> <3C7676AF.9020404@mail.com> 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 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:20261 Date: 2002-02-22T13:10:36-05:00 List-Id: "Hyman Rosen" wrote in message news:3C7676AF.9020404@mail.com... > Depending on how one builds it, a C++ class or class template > can fulfill the role of an Ada package, record, or tagged type. We all agree it's not a perfect comparison, since a class in C++ has type semantics and module semantics, and in Ada they are orthogonal. > That's just the way it is. This is not a description of ontic reality, it is a description of your subjective experience. I suggest you study instrumentalism (Dewey) or pragmatic philosophy (James, Peirce). See also Ernst von Glasersfeld and Heinz von Foerster. Indeed, any book on general systems theory. > To examine equivalent capabilities in the two languages, you > *must* use a C++ class to emulate an Ada package, otherwise > there will be all sorts of things that you can do in Ada that > won't be possible in C++. Wrong. An Ada package is a C++ namespace. An Ada private type is a C++ class. The fact that genericity is attached to modules in Ada rather than to the type itself is irrelevant. > It is simplistic and wrong to argue that a C++ class is just > like an Ada tagged type. Well, if a C++ class has virtual methods, then it has a vtable, which exactly corresponds to an Ada tagged type. A C++ class sans virtual methods has no vtable, and hence is equivalent to a nontagged Ada type. A C++ class is an Ada type. The fact that a C++ class has module semantics too is irrelevant. > That just is not how classes are used > in modern C++. It may appear to be cobbled together because of > the C heritage, and because a lot of the idioms were discovered > late in the game, but the non-tagged-type usages are at least > as important and useful as the OO stuff. On that we most certainly agree. The Ada community has been saying this from the very beginning, but certain pedantic computer scientists (and lots of obsequious programmers who followed the party line) weren't convinced. Thankfully Stroustrup has tempered this unbridled enthusiasm for all things "pure object-oriented" by demonstrating the benefits of non-extensible types and static method binding.