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,703c4f68db81387d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!news.belwue.de!news.tu-darmstadt.de!tsicnews.teliasonera.com!news.otenet.gr!news.grnet.gr!newsfd02.forthnet.gr!not-for-mail From: Ioannis Vranos Newsgroups: comp.lang.ada Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Fri, 25 Mar 2005 04:52:07 +0200 Organization: FORTHnet S.A., Atthidon 4, GR-17671 Kalithea, Greece, Tel: +30 2109559000, Fax: +30 2109559333, url: http://www.forthnet.gr Message-ID: <1111719129.745924@athnrd02> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> <4793664.vi5Yol0h1t@linux1.krischik.com> NNTP-Posting-Host: athnrd02.forthnet.gr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: athprx02.forthnet.gr 1111719129 16566 193.92.150.73 (25 Mar 2005 02:52:09 GMT) X-Complaints-To: abuse@forthnet.gr NNTP-Posting-Date: Fri, 25 Mar 2005 02:52:09 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en In-Reply-To: <4793664.vi5Yol0h1t@linux1.krischik.com> Cache-Post-Path: newsfd02!unknown@ppp16-adsl-51.ath.forthnet.gr Xref: g2news1.google.com comp.lang.ada:9954 Date: 2005-03-25T04:52:07+02:00 List-Id: Martin Krischik wrote: > Actualy there are only 3 of them. And they are usefull - two examples: > > I have worked a lot with SQL and I allways wound it cumbersome to map the > SQL string type to C++. Most SQL string types are bounded - they have a > maximum size. std::string (and IBM's IString) is unbounded - so before you > can store your string inside the database you have to make a sanity check. > In Ada I could use Ada.Strings.Bounded_Strings instead. > > The other example is CORBA. CORBA has two string types: string and > sting. In C++ both a mapped to std::string - and the CORBA/C++ > mapping must check the size of the sting. In Ada they are mapped to > Ada.Strings.Unbounded_Strings and Ada.Strings.Bounded_Strings. What about using const string. > > >>Ada's exception handling is also primitive at best (exceptionally so, >>if you'll pardon a pun). In particular, in Ada what you throw is >>essentially an enumaration -- a name that the compiler can match up >>with the same name in a handler, but nothing more. Only exact matches >>are supported and no information is included beyond the identity of the >>exception. > > > Well, Ada 95 added a 200 character informations string. > > >>In C++ you can throw an arbitrary type of object with an arbitrary >>value. All the information relevant to the situation at hand can be >>expressed cleanly and directly. The usual inheritance rules apply, so >>an exception handler can handle not only one specific exception, but an >>entire class of exceptions. Again, this idea can be expressed directly >>rather than as the logical OR of the individual values. And, once >>again, the addition of tagged records to Ada 95 testifies to the fact >>that even its own designers recognized the improvement this adds in >>general, but (whether due to shortsightedness, concerns for backward >>compatibility or whatever) didn't allow this improvement to be applied >>in this situation. > > > All true. But does that powerfull contruct works inside a multi tasking > environment. It is indeed true that Ada exeptions are restricted - but they > are thread save. And thead save means that an exception may be raised in > one thead and caugth in another. Exceptions raised inside an rendevous may > even be caught in both threads participating in the rendevous. > > And tread save is not all. An Ada system implementing the (optional) Annex E > needs exeptions which can be passed from one process to another. Both > processed runing on different computers. Just like CORBA exceptions. In C++, multithreading is platform-specific. I think this is better than Ada, but may be I am just used to it. -- Ioannis Vranos http://www23.brinkster.com/noicys