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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!xlned.com!feeder3.xlned.com!news2.euro.net!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!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: Dispatch on the result still does not work? 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: <4a58dfcf$0$30232$9b4e6d93@newsspool1.arcor-online.net> <1rfyxeircfmy1.19a1j3vqyttbo$.dlg@40tude.net> <74j6m.69502$rO.69160@newsfe13.ams2> Date: Sun, 12 Jul 2009 18:38:19 +0200 Message-ID: <1u2c96ysoamp2.1vn3copqwfld7$.dlg@40tude.net> NNTP-Posting-Date: 12 Jul 2009 18:38:20 CEST NNTP-Posting-Host: 3911d927.newsspool4.arcor-online.net X-Trace: DXC=4IFLJGTN2^:d8Nb@@ZG@b=4IUK`MVWQHG>DNcfSJ;bb[5IRnRBaCde]@goR\j\U?M5_@Cld2=a6 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7016 Date: 2009-07-12T18:38:20+02:00 List-Id: On Sun, 12 Jul 2009 17:05:06 +0100, Chris Moore wrote: > Dmitry A. Kazakov wrote: >> On Sun, 12 Jul 2009 11:40:27 +0100, Chris Moore wrote: > > > >>> But the results type is T'Class. It is not S. >> >> Exactly. To be of T'Class is a prerequisite for dispatch. >> >>> The original object to >>> which X refers is of type S. >> >> Therefore it could dispatch using S'Tag. > > Only if you use X.Value. Why shouldn't it? Consider: X : String := "abc"; begin X := ...; You have to use the value of X here in order to know the constraint checked in the assignment. Your premise that there is no or cannot be any interaction between the left and right hand sides of the assignment is wrong. In fact, in many cases it is highly desirable to have an access to non-finalized LHS in assignment, especially when dealing with memory-managed objects. >>> But this is destroyed prior to the >>> assignment of the value returned by Value. >> >> This is an implementation detail. > > This is how assignment works no matter what the language! Strictly speaking it does not. An assignment cannot destroy anything before assignment, i.e. itself. Destruction happens (if any) within the assignment. Nothing tells at which point it has to be done. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de