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,dbcfe2b0a74da57e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Inherited Methods and such 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: <1190296353.624737.150940@y42g2000hsy.googlegroups.com> <11m13st1f92kf$.m8s6y8mc8ebk.dlg@40tude.net> <1190321119.206313.65290@57g2000hsv.googlegroups.com> <1190408526.100291.265040@50g2000hsm.googlegroups.com> <9ukf2wtqjs0q$.iuijmal4x56b$.dlg@40tude.net> <1190497995.498679.119190@19g2000hsx.googlegroups.com> <1mw3qju08q8uj.sgzht7ld9ydc$.dlg@40tude.net> <1190579805.451187.71140@d55g2000hsg.googlegroups.com> <1i8ksr774bjbj.vpmnx3c0i9qz.dlg@40tude.net> <1190646125.024072.310020@19g2000hsx.googlegroups.com> <1r9s9v6pcjifl.vp4ktk0unpd1.dlg@40tude.net> <1190753631.240548.101820@19g2000hsx.googlegroups.com> <1190843408.713838.128690@g4g2000hsf.googlegroups.com> <1191012272.457766.273330@57g2000hsv.googlegroups.com> Date: Sat, 29 Sep 2007 22:35:04 +0200 Message-ID: NNTP-Posting-Date: 29 Sep 2007 22:35:05 CEST NNTP-Posting-Host: f4978ed4.newsspool3.arcor-online.net X-Trace: DXC=nkg_i3_VB8F2:OR3:3gaE@McF=Q^Z^V3H4Fo<]lROoRA^;5]aA^R6>B76HPZhYVlLI[6LHn;2LCVNCOgUkn_?_YOEgUICWDne[BIeK_ZLT72GI X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:2224 Date: 2007-09-29T22:35:05+02:00 List-Id: On Fri, 28 Sep 2007 13:44:32 -0700, Maciej Sobczak wrote: > On 28 Wrz, 21:42, Robert A Duff wrote: > >> Here's an example. What do you think? > > Perfect! I wasn't aware of the possibility to use return to achieve > this "progressive" construction process. It is not return, the job is done by extension aggregates, these are Ada 95 by the way. C++'s Derived () : Base (), Component () {} is equivalent to Ada's Derived'(Base with Component); What Ada 2005 return adds, is a non-empty body of, i.e. the stuff between {...} is do ... end return; Then Ada 2005 allowed aggregates for limited types. > I knew this form of return, but not the gory details of how tags are > assigned. The tag is set to reflect the object's type, what did you expect? (:-)) But note, nothing is mutating in the example. >> Do you revise your opinion that >> Ada doesn't properly support constructors? > > Yes, this example is convincing. No, it is not. Because aggregate is not a replacement for user-defined constructors. 1. It breaks encapsulation as you should make the record nature of type public. 2. The base type cannot enforce vital construction code, when records are exposed. 3. Nothing can be done for destructors. 4. Dispatch upon construction completion and before destruction beginning is still impossible. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de