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,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: Ada OO Mechanism Date: 1999/05/27 Message-ID: <7ik2ms$70i@news2.newsguy.com>#1/1 X-Deja-AN: 482819311 References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <7ieuja$5v9@news1.newsguy.com> Organization: ImagiNet Communications, Ltd. User-Agent: tin/pre-1.4-981002 ("Phobia") (UNIX) (AIX/3-2) Newsgroups: comp.lang.ada Date: 1999-05-27T00:00:00+00:00 List-Id: Hyman Rosen wrote: >... object-oriented techniques > that were harder, or less elegant, in C++ than in Ada. I asked > for examples with the thought that perhaps the posters didn't know > C++ as well as they knew Ada, As an aside, with the background that I happen to have, I can more easily multiply examples of object-oriented methods that are not supported in either language. Since I know that C++ implements a specific method, and that Ada's facilities are more generally oriented, it has been easy for me to believe the assertions of others that they find the C++ model restrictive in some instances. Logic programming is a simple example. In at least one Actor-based method that I am aware of, a message is itself an object, and can, while it exists, send and recieve messages. This certainly doesn't fit in with the model of a "message" being a function (or procedure) call, which is basic to the object-oriented programming model of both C++ and Ada. Again, there are some AI-type object-oriented systems that generate new subclasses on the fly, altering their fields and giving them new methods. These are generally written in Lisp, where one can execute data. To do this in either C++ or Ada, one would have to write roughly the equivalent of a Lisp interpreter in the base language, and then really write most of the program in that new language. By the way, one other point about Ada's "object-oriented" syntax is that it supports non-object-oriented programming by extension. This allows one to write base code, then write new code that extends the functionality of the old code without recompiling the base code. You can do this in C++ with classes, but you don't have to design in a class-based model to do this in Ada. If you're interested, I discussed this in appalling detail earlier -- do a Deja News power search on the phrase "infinite case statement" in comp.lang.ada, and read my "shorter and new" posting on the subject. (It took me a couple of tries to explain it clearly.) Best, Sam Mize -- Samuel Mize -- smize@imagin.net (home email) -- Team Ada Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam