comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Discriminants of tagged types
Date: Thu, 28 Oct 2010 01:50:51 -0700 (PDT)
Date: 2010-10-28T01:50:51-07:00	[thread overview]
Message-ID: <14f33f04-40f5-4a72-a18b-d511dd2eb3b3@w21g2000vby.googlegroups.com> (raw)
In-Reply-To: d7os66b802ns.1j7f7v8me5vgk.dlg@40tude.net

On 28 Paź, 09:53, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> > Because tagged types usually represent entities that are bound to some
> > resources
>
> This has nothing to do with copying. Consider a handle of a resource, e.g.
> HWND as an example. It is bound to the resource, nevertheless it is
> copyable.

Just like a file descriptor. Yet, there is no reason for these things
to be polymorphic.

Now consider a window or a file (as opposed to handle or descriptor).
They are different from handles and descriptors in that they represent
the target resources together with their lifetime management. That is,
I expect that finalizing the window object leads to the window being
closed or that finalizing the file object leads to the file being
flushed and closed, etc. Copy operations for such types are
meaningless.
What would it mean to copy a file object? Should the file on disk be
copied as well? Should the data that is still in the buffer be copied?
And so on. Instead of answering these questions in an unsatisfactory
way, it is better to outlaw the dubious operation up front.

> Rather the opposite, most of container types are not copyiable [*]

Is Vector limited?

> most of
> them are very useful to derive from [**].

I don't see any justification for this.

> ** You have to derive in many cases, because, again due to language
> limitations, containers are generic, which makes their raw instances
> sometimes unusable. Even if they are usable, quite often you would like to
> hide or reshape something in the container interface and that requires
> derivation.

I still don't see any justification, the above explanation is
circular.
Even if you can show an example where a language limitation prevents
you from doing something and thus justifies derivation, it is only a
proof that the language is broken, and not that the derivation
reflects any valid design objective.

--
Maciej Sobczak * http://www.inspirel.com



  reply	other threads:[~2010-10-28  8:50 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 12:16 Discriminants of tagged types Maciej Sobczak
2010-10-27 12:34 ` Ludovic Brenta
2010-10-27 13:19   ` Dmitry A. Kazakov
2010-10-27 13:52     ` Robert A Duff
2010-10-27 14:12       ` Dmitry A. Kazakov
2010-10-27 13:44 ` Robert A Duff
2010-10-27 15:06   ` Adam Beneschan
2010-10-27 15:58     ` Yannick Duchêne (Hibou57)
2010-10-27 16:35       ` Vinzent Hoefler
2010-10-27 17:58       ` J-P. Rosen
2010-10-27 20:18         ` Yannick Duchêne (Hibou57)
2010-10-27 20:26       ` Adam Beneschan
2010-10-27 22:07         ` Yannick Duchêne (Hibou57)
2010-10-27 22:42           ` Adam Beneschan
2010-10-27 15:13   ` Maciej Sobczak
2010-10-27 16:02     ` Yannick Duchêne (Hibou57)
2010-10-27 21:13       ` Maciej Sobczak
2010-10-27 21:23         ` Ludovic Brenta
2010-10-28  8:38           ` Maciej Sobczak
2010-10-27 21:25         ` Vinzent Hoefler
2010-10-28  7:53         ` Dmitry A. Kazakov
2010-10-28  8:50           ` Maciej Sobczak [this message]
2010-10-28 10:28             ` Dmitry A. Kazakov
2010-10-28 17:48             ` Yannick Duchêne (Hibou57)
2010-10-29 18:59             ` Vinzent Hoefler
2010-10-30 21:05               ` Maciej Sobczak
2010-10-30 21:21                 ` Vinzent Hoefler
2010-10-30 22:01                   ` Yannick Duchêne (Hibou57)
2010-10-31 16:20                   ` Maciej Sobczak
2010-10-31 17:04                     ` Yannick Duchêne (Hibou57)
2010-10-31 18:36                     ` Shark8
2010-10-31 21:06                       ` Maciej Sobczak
2010-11-01  0:44                         ` Shark8
2010-11-01  9:41                           ` Maciej Sobczak
2010-10-27 16:06     ` Robert A Duff
2010-10-27 16:34       ` Yannick Duchêne (Hibou57)
2010-10-27 21:05       ` Maciej Sobczak
2010-10-28  0:35         ` Robert A Duff
2010-10-28  8:55           ` Maciej Sobczak
2010-10-27 21:28       ` Simon Wright
2010-10-27 13:54 ` J-P. Rosen
replies disabled

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