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-10 06:06:15 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!btnet-peer0!btnet-peer!btnet!newspeer.clara.net!news.clara.net!news2.euro.net!bullseye.news.demon.net!news.demon.co.uk!demon!pipehawk.demon.co.uk!not-for-mail From: john.mccabe@emrad.com.nospam (John McCabe) Newsgroups: comp.lang.ada Subject: Re: on package naming, should the word "_pkg" be part of it? Date: Wed, 10 Oct 2001 13:05:09 GMT Organization: Emrad Ltd Message-ID: <3bc44449.9587095@news.demon.co.uk> References: <9pif1o01btl@drn.newsguy.com> <3BBD12F1.9BED0B70@acm.org> <20011009174047.V16689-100000@shell5.ba.best.com> <9q09d801073@drn.newsguy.com> NNTP-Posting-Host: pipehawk.demon.co.uk X-NNTP-Posting-Host: pipehawk.demon.co.uk:158.152.226.81 X-Trace: news.demon.co.uk 1002719121 nnrp-08:630 NO-IDENT pipehawk.demon.co.uk:158.152.226.81 X-Complaints-To: abuse@demon.net X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:14145 Date: 2001-10-10T13:05:09+00:00 List-Id: On 9 Oct 2001 18:48:24 -0700, Robert*@ wrote: >I wish the Ada95 designers would have introduced the class construct as in Me too but why not just: Class XXX is ... etc? The package mechanism had been in place for over 10 years as a method if encapsulation and so on. While I can see that the use of tagged types is an impressively versatile means of implementing OO features, I have found that, where OO implementations are required, the 'class' is generally mimicked by using a package with a single tagged type and its primitive operations. So instead of: package XXXs is type XXX is abstract tagged null record; procedure DoSomething (This : in XXX); procedure AClassOperation; end XXXs; package YYYs is type YYY is new XXX with record Item_1 : Integer; end record; ClassItem : Integer; end YYYs; why not have something like: class XXX is procedure DoSomething; procedure AClassOperation is classwide; end XXX; class YYY extends XXX is procedure DoSomething; Item_1 : Integer; ClassItem : Integer is classwide; -- Use classwide, not static!!! end YYY; So essentially a 'class' is just a package with an implicit tagged type. Surely this must have been considered, I mean, you could even write your classes like this and easily parse it into a package with a tagged type! Also, having worked with a number of people on Ada projects who had recently used Java, C++, Visual Basic etc, I think the lack of an object.method syntax was a serious limitation to their acceptance of Ada 95 as an OO language.