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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news.szaf.org!news.gnuher.de!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Mon, 13 Sep 2010 20:32:13 +0200 Message-ID: <878w35fqaa.fsf@mid.deneb.enyo.de> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1284402733 17357 172.17.135.6 (13 Sep 2010 18:32:13 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:hNSwKak08wo1DC3/IGmphSOJ7aE= Xref: g2news1.google.com comp.lang.ada:14051 Date: 2010-09-13T20:32:13+02:00 List-Id: * Dmitry A. Kazakov: >> Type extensions break encapsulation (at least if there non-abstract >> dispatching subprograms which contain some non-trivial code): the >> information which subprograms call each other under what circumstances >> leaks to the outside of the package. One very drastic way to >> implement that is to disallow type extensions for most non-abstract >> types you write, and consider the exceptions carefully. > > No, the actual problem here is re-dispatch. Just do not do that, it is > always bad. How do you suggest to avoid redispatch? Make non-dispatching calls to dispatching subprograms? And how does this address the issue? It makes it more likely that you cannot write a useful extension. Wouldn't it be better not to hide this aspect in the implementation?