comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Using Class wide types as factories, is this legit?
Date: Wed, 24 Sep 2014 09:22:47 +0200
Date: 2014-09-24T09:22:47+02:00	[thread overview]
Message-ID: <hlxq4uz977wk$.1vi0qx3sk7vok.dlg@40tude.net> (raw)
In-Reply-To: 2bfcf64f-0e19-4cf5-96df-14a360d2cb05@googlegroups.com

On Tue, 23 Sep 2014 14:27:01 -0700 (PDT), David Botton wrote:

>> Regarding your design. The rule of thumb is that controlled and other
>> copyable objects shall not have access discriminants.
> 
> rule of thumb? what would be your reasons to disallow?

Because you could return a copy of a local object referencing to another
local object [and will have to fight a long losing battle against Ada's
accessibility checks].

A copyable object must either carry everything with or else use some
collection schema (AKA closure) to prevent premature destruction of their
outstanding parts, e.g. reference counted pointers etc.

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


  reply	other threads:[~2014-09-24  7:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  5:19 Using Class wide types as factories, is this legit? David Botton
2014-09-23  7:23 ` Dmitry A. Kazakov
2014-09-23  8:21   ` David Botton
2014-09-23 19:28     ` Dmitry A. Kazakov
2014-09-23 21:27       ` David Botton
2014-09-24  7:22         ` Dmitry A. Kazakov [this message]
2014-09-23  8:37   ` briot.emmanuel
2014-09-23  8:52     ` David Botton
replies disabled

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