comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Dispatch on the result still does not work?
Date: Sun, 12 Jul 2009 18:38:19 +0200
Date: 2009-07-12T18:38:20+02:00	[thread overview]
Message-ID: <1u2c96ysoamp2.1vn3copqwfld7$.dlg@40tude.net> (raw)
In-Reply-To: sQn6m.65730$TT5.42015@newsfe18.ams2

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:
> 
> <snip>
> 
>>> 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



  reply	other threads:[~2009-07-12 16:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 10:04 Dispatch on the result still does not work? Dmitry A. Kazakov
2009-07-11 11:09 ` Chris Moore
2009-07-11 12:05   ` Dmitry A. Kazakov
2009-07-11 17:50     ` Chris Moore
2009-07-11 19:22       ` Dmitry A. Kazakov
2009-07-11 11:32 ` Hibou57 (Yannick Duchêne)
2009-07-11 12:20   ` Dmitry A. Kazakov
2009-07-11 13:36     ` Hibou57 (Yannick Duchêne)
2009-07-11 13:39       ` Hibou57 (Yannick Duchêne)
2009-07-11 15:19       ` Dmitry A. Kazakov
2009-07-11 18:08         ` Hibou57 (Yannick Duchêne)
2009-07-11 19:29           ` Dmitry A. Kazakov
2009-07-11 23:22             ` Hibou57 (Yannick Duchêne)
2009-07-12  9:46               ` Dmitry A. Kazakov
2009-07-11 18:54 ` Georg Bauhaus
2009-07-11 19:40   ` Dmitry A. Kazakov
2009-07-12 10:40     ` Chris Moore
2009-07-12 11:30       ` Dmitry A. Kazakov
2009-07-12 16:05         ` Chris Moore
2009-07-12 16:38           ` Dmitry A. Kazakov [this message]
2009-07-12 17:11             ` AdaMagica
2009-07-12 20:30               ` sjw
2009-07-13 16:55                 ` Adam Beneschan
2009-07-13 21:47                   ` sjw
2009-07-13 22:50                     ` Adam Beneschan
2009-07-14 21:06                       ` sjw
2009-07-13 15:13 ` Adam Beneschan
2009-07-13 15:17   ` Adam Beneschan
2009-07-13 16:33     ` AdaMagica
2009-07-13 18:46   ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox