comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Copy vector in Ada
Date: Mon, 5 Nov 2012 10:20:44 +0100
Date: 2012-11-05T10:20:44+01:00	[thread overview]
Message-ID: <1r3lpzblxy43h$.zytp8ur1bg27$.dlg@40tude.net> (raw)
In-Reply-To: 1ccf2169-418c-44b7-9d5a-b684a017fbe7@googlegroups.com

On Mon, 5 Nov 2012 00:50:25 -0800 (PST), Maciej Sobczak wrote:

> W dniu poniedzia�ek, 5 listopada 2012 09:31:13 UTC+1 u�ytkownik Dmitry A. Kazakov napisa�:
> 
>>> It is not "clearly" to me. Assigning Rectangles to Triangles does not make any sense.
>> 
>> Does the example presume that both are in the same hierarchy of types, e.g.
>> "shape"? Whether assignment makes sense depends on that.
> 
> You can always imagine arbitrary meanings of "assignment" and implement it, like:
> 
> D : Date;
> 
> D := "tomorrow";
> 
> But we are diverting from the subject of whether limitedness and
> assignment are supported consistently and orthogonally to other language
> features.

Then it was you who tried. My point was that assignment, or better to say,
copy constructor (from which assignment is deduced), is a
doubly-dispatching "operation." It is not orthogonal and cannot be.

There are lots of further questions about special treatment of copy
constructors, like whether one could introduce them later, e,g, promoting
limited types to non-limited and demoting back. These should be considered
in the larger context of disallowing operations, subtracting interfaces
etc. But the starting position is independent on that.

>>> I also mean what the programmer might possibly provide - Rectanges vs. Triangles and so on.
>> 
>> He will replace a triangular shape with a rectangular one.
> 
> Wrong. The existing alias of Trangle'Class will break.

What is alias?

As for "breaking" anything, that is technically speaking substitutability.
Substitutability is an issue if and only if, you inherit. Once the
programmer overrides or is forced to override there is no issue of
substitutability and there is no breaking. If you say that the programmer
could not implement the overridden operation without violation of some
semantic constraints that is another issue, not a language business, except
for checking static contracts. The programmer must then choose another type
hierarchy design, but that is outside the language scope.

>> You make some assumptions about the semantics of
>> assignment, which may or may not hold. Again, it is not the language
>> business.
> 
> Yes. Let's agree that the language should allow this possibility.
> We are still diverting from the subject of whether the existing solution
> is elegant and orthogonal with respect to other language features.

Neither elegant, nor orthogonal. Both languages did it wrong.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-11-08  5:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:26 Copy vector in Ada katolsster
2012-10-31 16:37 ` Jeffrey Carter
2012-11-02 11:10   ` katarina.l.olsson
2012-11-02 11:19     ` Yannick Duchêne (Hibou57)
2012-11-02 22:03       ` Maciej Sobczak
2012-11-02 23:45         ` Yannick Duchêne (Hibou57)
2012-11-03  0:15           ` Zhu, Qun-Ying
2012-11-03  3:47             ` Peter C. Chapin
2012-11-03 15:47               ` Yannick Duchêne (Hibou57)
2012-11-03 14:34           ` Maciej Sobczak
2012-11-03 15:54             ` Yannick Duchêne (Hibou57)
2012-11-03 16:03               ` Yannick Duchêne (Hibou57)
2012-11-03 21:57                 ` Maciej Sobczak
2012-11-04  7:25                   ` Dmitry A. Kazakov
2012-11-04 20:49                     ` Maciej Sobczak
2012-11-05  8:31                       ` Dmitry A. Kazakov
2012-11-05  8:50                         ` Maciej Sobczak
2012-11-05  9:20                           ` Dmitry A. Kazakov [this message]
2012-11-05 17:22                             ` Yannick Duchêne (Hibou57)
2012-11-05 18:42                               ` Dmitry A. Kazakov
2012-11-05 20:18                                 ` Yannick Duchêne (Hibou57)
2012-11-05 20:33                                   ` Dmitry A. Kazakov
2012-11-05 21:34                                     ` Yannick Duchêne (Hibou57)
2012-11-05 23:45                                       ` Shark8
2012-11-05 23:58                                         ` Hibou57 (Yannick Duchêne)
2012-11-06  2:17                                           ` Yannick Duchêne (Hibou57)
2012-11-06  7:28                                             ` Types vs Subtypes (was: Re: Copy vector in Ada) Simon Wright
2012-11-06 11:33                                             ` Copy vector in Ada Georg Bauhaus
2012-11-06 19:47                                               ` Yannick Duchêne (Hibou57)
2012-11-06 19:53                                                 ` Yannick Duchêne (Hibou57)
2012-11-07 12:03                                                 ` Georg Bauhaus
2012-11-07 13:09                                                   ` Dmitry A. Kazakov
2012-11-07 16:17                                                     ` Yannick Duchêne (Hibou57)
2012-11-07 16:11                                                   ` Yannick Duchêne (Hibou57)
2012-11-07 18:06                                                     ` Georg Bauhaus
2012-11-07 20:04                                                       ` Dmitry A. Kazakov
2012-11-07 21:00                                                         ` Yannick Duchêne (Hibou57)
2012-11-08  8:31                                                           ` Dmitry A. Kazakov
2012-11-08  9:58                                                         ` Georg Bauhaus
2012-11-08 14:28                                                           ` Dmitry A. Kazakov
2012-11-05 16:30                         ` Yannick Duchêne (Hibou57)
2012-11-02 14:10     ` Georg Bauhaus
2012-11-02 15:28       ` Shark8
2012-11-09  6:22         ` Randy Brukardt
2012-11-19 22:37 ` Katarina Olsson
2012-11-19 22:39 ` Katarina Olsson
replies disabled

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