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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7251fa99aab97e06 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-12 22:06:22 PST Newsgroups: comp.lang.ada Path: sparky!uunet!gatech!howland.reston.ans.net!agate!dog.ee.lbl.gov!newshub.nosc.mil!nosc!crash!telesoft!kst From: kst@telesoft.com (Keith Thompson @pulsar) Subject: Re: Ichibah flames, and flames out over, Ada 9X Message-ID: <1993Mar13.031104.21673@telesoft.com> Organization: Alsys, San Diego, CA, USA References: <1993Mar10.201515.6295@evb.com> <1993Mar12.160136.6106@evb.com> Date: Sat, 13 Mar 1993 03:11:04 GMT Date: 1993-03-13T03:11:04+00:00 List-Id: In article <1993Mar12.160136.6106@evb.com> pole@evb.com (Tom Pole) writes: > [...] > If Ada wants to attract/convince/whatever programmers to use Ada, and > that it is truly an OOPL, then Ada should use the accepted (de facto standard) > terminology of OORequirements Analysis, OODesign, OOetc. > > A class is a class. If Ada wants to add the ability to have > inheritance/specialization similar to what is available in other > OOPL's, the OO world calls the common definition > of a type which supports specialization a class, and instantiations > of that type objects. Ada can use the same terms if it wishes. > [...] Many years ago, when I first read the preliminary Ada reference manual (the 1979 version), I had a lot of trouble understanding the section on access types, with its discussion of access values "designating" objects and so forth. Not long after that, I realized that access types are (essentially) what Pascal calls pointer types. (Pascal was the language I was most familiar with at the time.) The current (1983) Ada reference manual has a note explaining that "Access values are called pointers or references in other languages" (3.8:10); the 1979 preliminary version probably had a similar note, but I missed it at first. Once I had made that connection, I didn't have any problem understanding what access types are and how they work; most of what I had learned about Pascal pointer types applied almost directly to Ada access types. My point is that these minor differences in terminology (pointers vs. access types, classes vs. tagged types, functions returning void vs. procedures) really don't matter. It should take literally no more than a few seconds to make the connection between similar features in different languages, once the correlation is pointed out. Furthermore, as others have mentioned, a C++ class is both a type and a unit of encapsulation. The Ada equivalent of a C++ class would be a package containing declarations for a single type and its operations, but Ada also allows declarations of any set of logically related entities to be grouped into a package. In my opinion, this is a considerable advantage of Ada over C++. Ok, so I'm simultaneously arguing that the difference in terminology doesn't matter because the constructs are the same, and that the terminology should be different because the constructs are different. You expect consistency in a Usenet posting? 8-)} Seriously, I believe that Ada 9X tagged types provide essentially the same capabilities as C++ classes, in a way that fits well into the existing Ada 83 framework of packages, derived types, and so on. I see little point in making the purely syntactic change from "type Foo is tagged record ..." to "class type Foo is record ...". Any more extensive change, like making classes a unit of encapsulation, would do too much violence to the overall structure of the language. The Ada 9X reference manual should probably have a note pointing out the correlation between tagged types and the various class constructs of C++ and other object-oriented languages. -- Keith Thompson (The_Other_Keith) kst@telesoft.com TeleSoft^H^H^H^H^H^H^H^H Alsys, Inc. 5959 Cornerstone Court West, San Diego, CA, USA, 92121-9891 "Listen to me, people! We must stick them with quills -- it's the only way!"