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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Preventing type extensions 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: <87iq2bfenl.fsf@mid.deneb.enyo.de> <874odv9npv.fsf@ludovic-brenta.org> <87y6b7cedd.fsf@mid.deneb.enyo.de> <66a3704c-54f9-4f04-8860-aa12f516134b@t3g2000vbb.googlegroups.com> <87d3sib44t.fsf@mid.deneb.enyo.de> <134q4k2ly2pf4$.17nlv1q6q5ivo.dlg@40tude.net> <4c8dec8e$0$6990$9b4e6d93@newsspool4.arcor-online.net> <8f6cceFrv2U1@mid.individual.net> Date: Mon, 13 Sep 2010 15:05:20 +0200 Message-ID: <18oiywskxfib5.9den27hp0plc.dlg@40tude.net> NNTP-Posting-Date: 13 Sep 2010 15:05:20 CEST NNTP-Posting-Host: 7caababd.newsspool1.arcor-online.net X-Trace: DXC=C`GXNmmLT03QbA1[CgMQ00ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2kkLKTNdlU26[6LHn;2LCV>7enW;^6ZC`4\`mfM[68DC3ckNU0gO7EG; X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14039 Date: 2010-09-13T15:05:20+02:00 List-Id: On Mon, 13 Sep 2010 13:23:10 +0300, Niklas Holsti wrote: > Dmitry A. Kazakov wrote: > >> re-dispatch is the problem, not aggregation or delegation. Don't implement >> anything by means of re-dispatch and you will have no "callbacks." A type >> extension cannot break anything in the parent's implementation unless it >> re-dispatches. > > Conversely, there are architectures (sensible ones, in my opinion) in > which the extension is broken, or is difficult or cumbersome to > implement, if the parent does *not* re-dispatch. I am not sure if these case aren't kludges caused by other language deficiencies (e.g. lack of MI, MD, constructors etc). > Next question: Should the language provide means to express the uses of > re-dispatch, in the declaration of a tagged type and its operations? For > example, "primitive operation Foo calls primitive operation Bar with > re-dispatch". In my view a better alternative would be extensible primitive operations, when "overriding" rather inserts prologue or epilogue than replaces all body. One could consider dispatch restricted to class-wide operations while allowing T'Class'Class. Then operations class-wide for T would be primitive for T'Class. I.e. one could override them within T'Class'Class. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de