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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a0be06fbc0dd71f1 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: The future of Ada is at risk Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <20071229040639.f753f982.coolzone@it.dk> <87d4sg372q.fsf@ludovic-brenta.org> <1pb4s8untit3q$.qze96ty5hmxc.dlg@40tude.net> Date: Sat, 5 Jan 2008 18:14:01 +0100 Message-ID: <167wcbinm86qp$.2oyaodychvhh$.dlg@40tude.net> NNTP-Posting-Date: 05 Jan 2008 18:14:01 CET NNTP-Posting-Host: 359219a1.newsspool2.arcor-online.net X-Trace: DXC=H8RmEE7bk:E2jYf>V4L0gLA9EHlD;3YcB4Fo<]lROoRAnkgeX?EC@@@Dh@6F3aA[HJ[6LHn;2LCVN[ On Sat, 05 Jan 2008 10:46:23 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >>> I don't understand the complaint about constructors -- Ada 2005 is >>> pretty good in this area (better than C++, IMHO). >> >> People complain that there is no user-defined initialization, safe, and for >> all types. (Ada.Finalization hack does not count.) > > What's wrong with initializing objects with function calls? Ada lacks extensible functions. The predefined constructing function are anonymous. They cannot be made abstract, private or hidden by other means. So overriding/overloading of constructing functions is unsafe, it leaks. > It has advantages over the C++ way, and I don't see the > disadvantage(s). I think that C++ model is more in Ada spirit, because it does not assume more than absolutely necessary about constructed objects. With functions you have to be able to return the object, which should be constructed before ... its construction and returned before it exists, being neither allocated, nor copied. It is a misuse of otherwise clean concept of a function with a return parameter. Say I want to construct a task, why should I invent "aggregates of tasks" in order to be able to "return" one from a "constructing function"? Functions compose in absolutely different manner than initializers do. So you need brackets like aggregates and weird scoped return statements to put around in order to glue them. It is just counterintuitive. >>> I'm not sure I understand the finalization issue. >> >> Same as initialization. > > I don't get it. How to enforce execution of my code on say an access type, when the pointer object gets destroyed? (What is an inverse for function? (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de