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,70414f56d810c10c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Sun, 18 Sep 2011 20:15:08 +0200 Organization: cbb software GmbH Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <86015926-d652-4265-aedd-413312d399f9@dq7g2000vbb.googlegroups.com> <0d272f62-67d0-4905-972c-8a7e912c5531@en1g2000vbb.googlegroups.com> <148cxoyabima2.16mz6xwdph2hj.dlg@40tude.net> <01a1374f-59ab-40be-9e39-0640cb2a513d@n35g2000yqf.googlegroups.com> <1fp2o673mu9az$.d9loz1zbcl0d.dlg@40tude.net> <1q85zv3i9ccq6$.17nr90hvonwic$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: bvyow2Wh9lV3ygBU/WDjGg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:21962 Date: 2011-09-18T20:15:08+02:00 List-Id: On Sun, 18 Sep 2011 09:32:00 -0700 (PDT), ytomino wrote: > Smart pointer shold support type conversions supported on raw access > types like access all to access constant, or derived type to base type. They should rather be transparent to constraining, e.g. immutability constraint must propagate from the target subtype to the pointer subtype. Compare it with renaming. When you rename an immutable object the result is immutable. > Indefinite_Holder does not support these conversions. There is Implicit_Dereference aspect introduced in Ada 2012, but in such a strange way that made it impossible to define on Holder itself, rather on another type obtained from Holder using a function! What was the gain? >> X + Y > If semantics of smart pointer differs from semantics of value, it may > make misunderstanding. There is no difference, compare it with by-reference parameters. The program shall not be written to exploit by-reference vs. by-value. Smart pointer is a substitute for what it points to. > (so I prefer to write X.all + Y.all) If you are happy with such mess, then what is wrong with X.Element + Y.Element? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de