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-Thread: 103376,131f06967722ab4b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005? Date: Sat, 18 Dec 2004 17:03:13 +0100 Organization: cbb software GmbH Message-ID: <1n1v6175zrtcc.2g6ewdvu7ei5$.dlg@40tude.net> References: <1103344064.372396.51420@c13g2000cwb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net UYL7rVSSKrxKZ0EVvlB6ggfUFyMrWLpKSuJ9dpL9/FTdsszIs= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7049 Date: 2004-12-18T17:03:13+01:00 List-Id: On 17 Dec 2004 20:27:44 -0800, conradwt@runbox.com wrote: > It seems that I'm trying to mimic the behavior of a OO language in a > procedural language when converting C++ to Ada. Is this correct? If > so, why doesn't Ada have OO contructs similar to C++, > Java, Eiffel, and Smalltalk to name a few where one passes a message to > an instance of a class? Because it is inconsistent. Method is not a property of a class (=type), the relation is not 1-1. So the idea of a message sent to invoke a member of an object is plainly wrong. Consider nasty consequences in C++: class Device { public : void Copy (From : Device); }; The above is infeasible, it will not dispatch in From for: Printer.Copy (Display); what is the recipient here? Printer or Display? The only correct answer is both. So Copy should be defined not on Device, but on Device x Device (tuple). The word class as it is used in C++ is just a type. There is no need to call types classes. BTW, it has nothing to do with OO. Ada uses the word "class" for types of polymorphic objects. It is specified as T'Class. Using the same word for something else would be misleading. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de