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-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 12 Mar 2005 09:52:45 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: 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> <1110377260.350158.58730@z14g2000cwz.googlegroups.com> <1110383768.773379.61780@o13g2000cwo.googlegroups.com> <399tkeF5utki4U1@individual.net> NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1110639167 29368 69.38.147.31 (12 Mar 2005 14:52:47 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 12 Mar 2005 14:52:47 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:9236 comp.lang.c++:45296 comp.realtime:1368 comp.software-eng:4928 Date: 2005-03-12T09:52:45-05:00 List-Id: Falk Tannh�user writes: > I believe Ada also has exceptions, but I don't know if > they work in the same manner. Does Ada have some equivalent > of C++ constructors and destructors? Yes. I believe that the C++ exception design was based on Ada exceptions, and the Ada finalization stuff was based on the C++ features. The differences in these areas are fairly minor. I guess the biggest one is that a C++ exception is a first-class object, so you can pass extra information along with a thrown exception in a straightforward way, whereas in Ada, the mechanism for passing extra information is an ugly kludge. Another difference is that Ada doesn't rely so heavily on constructors -- there is something like a constructor in Ada, but the *usual* way to create objects is simply to call a function that returns one, as in: X: Int_Set := Empty_Set; Y: constant Int_Set := Singleton_Set(17); - Bob