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!news3.google.com!fu-berlin.de!newsfeed.arcor.de!newsspool2.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: <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> <1191099160.227234.125330@r29g2000hsg.googlegroups.com> Date: Sun, 30 Sep 2007 10:38:11 +0200 Message-ID: <18raoy77i431w.1diy3loydmq9h$.dlg@40tude.net> NNTP-Posting-Date: 30 Sep 2007 10:38:12 CEST NNTP-Posting-Host: 08a0d075.newsspool4.arcor-online.net X-Trace: DXC=WXX=l16WbW7S]SUVZ];98lKCJC39a4=> X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:2234 Date: 2007-09-30T10:38:12+02:00 List-Id: On Sat, 29 Sep 2007 13:52:40 -0700, Maciej Sobczak wrote: > On 29 Wrz, 22:35, "Dmitry A. Kazakov" > wrote: > >> 1. It breaks encapsulation as you should make the record nature of type >> public. > > Why it would make any difference? > The type is tagged and this is known. If it's tagged, then it has the > record nature - no way and no reason to hide it. It is a language fault that there are types which cannot be user-constructed. The problem is that if you tried to fix the language, for example by allowing a task object being shut down when finalized, you would make them all records. Is it LISP or Ada? >> 2. The base type cannot enforce vital construction code, when records are >> exposed. > > I don't understand this part. If the object is just a record I can assemble it in any available way. And there are many of them. You will have a difficult design problem to ensure that all these ways do call your construction code. For example: Uninitialized base: X : Base; begin return (X with ...) do ... end record; Worked-around base: return (X'(Xs_Base with Something) with ...) do ... end record; >> 4. Dispatch upon construction completion and before destruction beginning >> is still impossible. > Why? It goes this way: return (Base with Mine) do My-take end record; But the [class-wide] code to execute should be placed after "end record," IFF there is no following derived type under construction. Only compiler magic can help here. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de