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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site loral.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxb!mhuxr!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcc3!sdcc6!loral!ian From: ian@loral.UUCP (Ian Kaplan) Newsgroups: net.lang.st80,net.lang.ada,net.lang.mod2 Subject: Re: Definition of Buzzwords: "Object-Oriented" Message-ID: <777@loral.UUCP> Date: Mon, 4-Feb-85 10:47:28 EST Article-I.D.: loral.777 Posted: Mon Feb 4 10:47:28 1985 Date-Received: Thu, 7-Feb-85 02:33:35 EST References: <769@loral.UUCP> <247@cheviot.UUCP> Reply-To: ian@loral.UUCP (Ian Kaplan) Distribution: net Organization: Loral Instrumentation, San Diego Xref: watmath net.lang.st80:178 net.lang.ada:178 net.lang.mod2:157 Summary: Inheritance is the key factor in "object orientedness" List-Id: In article <247@cheviot.UUCP> robert@cheviot.UUCP (Robert Stroud) writes: > >But it *is* possible to define abstract types in Modula-2, (or Ada - hiss!). > >Modula-2 lets you export a TYPE name without defining the TYPE structure - >this is called "opaque export" and is discussed under "14. Compilation Units" >in my version of the Modula-2 Report. > >You can then declare variables of this type, but the only way you can use >them is as parameters to procedures or functions exported by the MODULE >which defines the TYPE - where the internal structure is known. So if >we have a MODULE StackDef which EXPORT's the TYPE Stack and procedures >Push and Pop, we can write.... > > FROM StackDef IMPORT Stack, Push, Pop; > > VAR > S : Stack; > > BEGIN > ... > Push(S, ...); > Pop(S, ...); > ... > END; > >You even have to call an exported procedure (not shown) to initialise >the Stack before you use it - unlike Ada, Modula-2 does not allow >initialisation at declaration. > >This is *not* the same as Concurrent Pascal notation, > > S.Push(...); S.Pop(...); > >but the difference is really just philosophical - does the operation >belong to the object or vice-versa. Some would say that this makes >a language "object-oriented" rather than "procedure-oriented" although >the distinction is purely syntactic sugar. > ... more discussion regarding packaging in Ada etc.... >Is it possible to focus on that difference and produce >a definition of "object-oriented" that *excludes* Modula-2?? > >Robert Stroud, >Computing Laboratory, >University of Newcastle upon Tyne. > >ARPA robert%cheviot%newcastle.mailnet@mit-multics.arpa >UUCP ...!ukc!cheviot!robert > The point that I was trying to make in my Concurrent Pascal example was that there should be a strong association between the data structure and the operations that can be perfored on it. I think that Robert Stroud is probably right when he states that the differences between my Concurrent Pascal example and the way the same thing is done in Modula is syntatic sugar. After I wrote my article several other people pointed out that the real difference between Modula (or Ada) and an object oriented language like Smalltalk or C++ is inheritance. Inheritance allows new abstract data types to be formed from the "properties" of other abstract data types. In a way, inheritance does for abstract data types what user defined data types does for elementary data types in Modula. When discussion the differences between a "truely" object oriented language and Modula with a friend, my friend pointed out that you must make a distinction between what you can simulate in a language and the properties of the language. For example, a programmer can simulate recursion in FORTRAN by using an array like a stack, but recursion is not one of the features of FORTRAN. There is clearly some overlap between the object oriented languages and Modula or Ada. Despite this overlap, they really are different languages. I think that the problems we are all having in defining the differences between object oreinted languages and Modula is that until recently (when the mini-Smalltalk implementation became available) object oriented languages were not generally available. I believe that if we were to use object oriented languages, rather than just read about them, the difference would be much more apparent. By the way, from what I understand AT&T has no plans to release C++. If this is true, I think that it is a real loss to the computer science community. Ian Kaplan Loral Data Flow Group Loral Instrumentation (619) 560-5888 x4812 USENET: {ucbvax,ihnp4}!sdcsvax!sdcc6!loral!ian ARPA: sdcc6!loral!ian@UCSD USPS: 8401 Aero Dr. San Diego, CA 92123