comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: non record limited type
Date: Fri, 23 Feb 2018 09:58:15 +0100
Date: 2018-02-23T09:58:15+01:00	[thread overview]
Message-ID: <p6ol37$15fq$1@gioia.aioe.org> (raw)
In-Reply-To: p6njf9$nae$1@franka.jacob-sparre.dk

On 23/02/2018 00:24, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:p6luqm$jb1$1@gioia.aioe.org...
>> On 22/02/2018 02:29, Randy Brukardt wrote:
>>
>>> These types that become limited just because of "limited private" also
>>> have
>>> the nasty property of becoming non-limited when you can see the full
>>> declaration. This causes all kinds of semantic complications that we'd
>>> rather not repeat, so everything new requires declaring it limited
>>> explicitly and staying that way.
>>
>> I don't see anything wrong with that, except for coupling to by-reference
>> semantics. On/off visibility of the copying operation is all OK, it is
>> just an operation. Parameter passing method is a different thing.
> 
> Not to Ada: by-copy uses the assignment operation (which isn't quite the
> same thing as :=). Limited assignment is build-in-place only (for
> initialization purposes, another rule I know you hate). Probably could be
> different, but it would take extra work, and so far, there doesn't seem to
> be much need.

Right, but by-copy passing is not really assignment. It is a 
copy-constructor. When assignment finalizes the target, copy-constructor 
does not do anything. Ideally we should be able to disable ":=" while 
keeping by-copy passing. I can imagine use cases for short-lived smart 
pointers and iterators where I wanted no explicit copies made.

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

      reply	other threads:[~2018-02-23  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 15:58 non record limited type Mehdi Saada
2018-02-21 21:42 ` Jere
2018-02-21 22:29   ` Mehdi Saada
2018-02-21 23:08     ` Jere
2018-02-21 23:14     ` Jere
2018-02-22  0:09       ` Mehdi Saada
2018-02-22  0:26         ` Mehdi Saada
2018-02-22  2:57           ` Jere
2018-02-22 16:45         ` Jeffrey R. Carter
2018-02-22 17:06           ` Dmitry A. Kazakov
2018-02-22  7:56       ` Simon Wright
2018-02-22  1:20     ` Randy Brukardt
2018-02-22  1:29 ` Randy Brukardt
2018-02-22  8:25   ` Dmitry A. Kazakov
2018-02-22 23:24     ` Randy Brukardt
2018-02-23  8:58       ` Dmitry A. Kazakov [this message]
replies disabled

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