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: a07f3367d7,366b213c4abb1039 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!192.87.166.28.MISMATCH!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed10.multikabel.net!feed.xsnews.nl!border-2.ams.xsnews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: What makes a procedure call 'dispatching' in Ada? 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: <4b06a048$0$26319$4f793bc4@news.tdc.fi> Date: Fri, 20 Nov 2009 15:31:26 +0100 Message-ID: <1ced67sbv38ke.1973smwq7n0uw.dlg@40tude.net> NNTP-Posting-Date: 20 Nov 2009 15:31:26 CET NNTP-Posting-Host: 8af35137.newsspool2.arcor-online.net X-Trace: DXC=f?:\_kP>n5YPU8j_I0DN6_A9EHlD;3YcR4Fo<]lROoRQ8kF_o8=S9bKPnd] X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8176 Date: 2009-11-20T15:31:26+01:00 List-Id: On Fri, 20 Nov 2009 15:56:50 +0200, Niklas Holsti wrote: > Dmitry has philosophical objections to redispatching, which is why he > suggests that you should declare P with a class-type parameter THIS in > the first place, so that A (THIS) will dispatch. I would not call them philosophical. If you see the code like if X = 1 then ... if X = 1 then ... end if; ... if X = 1 then ... end if; ... you start suggesting that there could be something wrong here. Re-dispatch is not an error it is an indication of a potential design problem. Why would you need to check twice the same tag? That requires an explanation in the design document and comments in the code. A technical issue is that if we had tagged types of value semantics (i.e. classes rooted in Boolean, Integer etc), then re-dispatch could not work with them. I.e. from Ada's agnostic point of view on by-value vs. by-reference, re-dispatch (or speaking more generally, view conversion to T'Class) is an implementation-specific kludge. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de