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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,900edaa189af2033 X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Re: Ada95 OOP Questions Date: 1996/08/08 Message-ID: <9608082242.AA14378@most>#1/1 X-Deja-AN: 173078782 sender: Ada programming language comments: To: info-ada%listserv.nodak.edu@emcee.com mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-08-08T00:00:00+00:00 List-Id: You also have a readability question with regard to the syntax you've been discussing. If Fred is type (class) Person and Fido is Dog, then at first glance what would be the "intuitive" output of the following? C++ - Fred.bite(Fido) Ada - Persons.Bite(Fred,Fido); Is it "Yelp!" or "You miserable mutt!" ? :-) Not a very good example, but what I'm getting at is, if you're using English words for your identifiers, then English word order can reinforce or work against the meaning in either case. In previous posts, C++ Fred.eat; Ada Persons.Eat(Fred); If these are equivalent, perhaps the Ada translation should be Persons.Eating_Should_Be(Fred); :-) Now set that foolishness aside. Do you want to make your Ada look like C++ ? Without giving up arrays and linked lists? Although they weren't intended for this, protected types/objects can do it! They can have not only functions, but procedures and entries. protected type Person is -- maybe 'does' should be a synonym for 'is' :-) procedure Eat; procedure Sleep; procedure Work; -- is there more to life? end Person; type Crowd is array (Natural range <>) of Person; -- I am sure the rest is obvious.... ... and even Ada-83 could do it with task types, provided identifiers were carefully chosen. Not that I would necessarily recommend it, but it may in some designs model the real world better than non-concurrent objects. --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Hughes Defense Communications (MS 10-40) Home: 219-471-7206 Fort Wayne, IN 46808 (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------