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,FREEMAIL_FROM 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!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "christov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005? Date: 18 Dec 2004 00:47:04 -0800 Organization: http://groups.google.com Message-ID: <1103359624.475636.116510@z14g2000cwz.googlegroups.com> References: <1103344064.372396.51420@c13g2000cwb.googlegroups.com> NNTP-Posting-Host: 207.213.217.210 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1103359629 13652 127.0.0.1 (18 Dec 2004 08:47:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 18 Dec 2004 08:47:09 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=207.213.217.210; posting-account=iMifBw0AAAALJxfwhhZ9vT7AaNknQQfX Xref: g2news1.google.com comp.lang.ada:7045 Date: 2004-12-18T00:47:04-08:00 List-Id: conradwt@runbox.com wrote: > Hi, will Ada support keyword class for designing and implementing > classes? For example, I'm forced to convert the following C++ class in > Ada as follows: No, I do not think that Ada 2005 will support the keyword "class". Ada 2005 will add the "interface" keyword however. (I haven't read up on it yet.) [non-object-oriented code examples snipped] Neither of your code examples really show much "object-orientation." The best that you can say is that both examples show encapulation and static function binding. The C++ example is just a syntactic sugar over what is easily acheivable in plain C. The Ada example, while you use tagged types, does not show any methods taking Classwide parameters and thus use dynamic dispatch. The syntax difference is just that, a syntax difference. Looking at the Ada Issues database it does look like Ada 2005 will support an Object.Operation(...) style of notation. It will provide a more familiar syntax for C++/Java programmers who balk at Package.Operation(Object,...). > > 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? Will this be something in Ada 2005 because I > have been able to find a good overview of the language to date? Well, > I must go and thanks for any comments that you may send me. Ada95 is at least as object oriented as C++ in that it offers data encapulation, type heirarchies, dynamic dispatch, abstract types and methods, etc. The syntax and procedure for their use are different. Packages provide the mechanism for encapsulation and specialization in Ada. Tagged types and subprograms taking Type'Class arguments (declared in the same package) provide the method for dynamic dispatch and type inheiritance. I also think that many Smalltalk adherants would be dismayed to find you lumping that language in with C++ and Java. Smalltalk (and Objective C) are message passing, dynamically bound OO languages. C++ is not a message passing language. If you want a good book on Ada, I recommend _Programming in Ada95, 2nd edition_ by John Barnes. There are also several excellent refferences on Ada to be found for free from sites like http://www.adapower.com/ or http://www.adaworld.com/. Adacore has a short summary of Ada 2005 at http://www.adacore.com/ada_2005.php. If you want to go to the source then http://www.ada-auth.org/arg-minutes.html shows the language design process in all of its messy glory. I really don't recommend it for beginers though. I try to steer clear myself. :-) Cheers, Chris