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-Thread: a07f3367d7,4ce5890331a5b529 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!217.73.144.44.MISMATCH!feeder.ecngs.de!ecngs!feeder2.ecngs.de!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Discriminants of tagged types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-16" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <14314714-e92c-4036-9cbb-da8e72489261@h7g2000yqn.googlegroups.com> <3243de1d-c6b4-4845-ab5f-28ea4e9f5738@c20g2000yqj.googlegroups.com> Date: Thu, 28 Oct 2010 09:53:27 +0200 Message-ID: NNTP-Posting-Date: 28 Oct 2010 09:53:27 CEST NNTP-Posting-Host: 6d6a56cf.newsspool1.arcor-online.net X-Trace: DXC=[cFf1Y>]e>o]l@YUW5NBknic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgbL8lJ>3=`J`c[6LHn;2LCVn7enW;^6ZC`d\`mfM[68DCceURiBFbUUnh X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14879 Date: 2010-10-28T09:53:27+02:00 List-Id: On Wed, 27 Oct 2010 14:13:41 -0700 (PDT), Maciej Sobczak wrote: > On 27 Pa�, 18:02, Yannick Duch�ne (Hibou57) > 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