comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Discriminants of tagged types
Date: Thu, 28 Oct 2010 09:53:27 +0200
Date: 2010-10-28T09:53:27+02:00	[thread overview]
Message-ID: <d7os66b802ns.1j7f7v8me5vgk.dlg@40tude.net> (raw)
In-Reply-To: 3243de1d-c6b4-4845-ab5f-28ea4e9f5738@c20g2000yqj.googlegroups.com

On Wed, 27 Oct 2010 14:13:41 -0700 (PDT), Maciej Sobczak wrote:

> On 27 Païżœ, 18:02, Yannick Duchïżœne (Hibou57) <yannick_duch...@yahoo.fr>
> wrote:
> 
>>> as non-limited tagged types are nonsense anyway.
>>
>> Why ?
> 
> 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.

> and copying them is somewhere between cumbersome and
> impossible. Communication channels, database connections, etc.

You conflate copying the resource and copying a proxy object.

> In Ada the only types I'm aware of which are tagged and which have
> justifiable copy semantics are containers - but you might as well
> argue that there is no reason whatsoever for them to be tagged, which
> only proves my point.

Rather the opposite, most of container types are not copyiable [*], most of
them are very useful to derive from [**].

----
* The picture with containers is quite distorted by language limitations.
The problem is that the properties of the container element types are not
inherited by the container type, but they necessarily constrain the latter.
The language does not provide any means to control this. So if the elements
are copyable that does not make the container copyable, though in some
cases it would make sense. The result is that the least requirement on the
elements (limited) translates into limited container types.

** 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.

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



  parent reply	other threads:[~2010-10-28  7:53 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 [this message]
2010-10-28  8:50           ` Maciej Sobczak
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