comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: smart pointer dangerous (no -> operator)
Date: Fri, 16 Jan 2009 13:43:15 +0100
Date: 2009-01-16T13:43:16+01:00	[thread overview]
Message-ID: <gm4e8cgq6tqq.h9845yzrg7ov$.dlg@40tude.net> (raw)
In-Reply-To: 49707299$0$32667$9b4e6d93@newsspool2.arcor-online.net

On Fri, 16 Jan 2009 12:42:17 +0100, Georg Bauhaus wrote:

> Dmitry A. Kazakov schrieb:
>> On Fri, 16 Jan 2009 11:04:57 +0100, Oliver Kowalke wrote:
>> 
>>> Ada doesn't support the dereference operator -> as C++.
>>>
>>> So Ada provides only two ways to access the managed object?
> 
>> Two major problems are:
>> 
>> 1. Lack of delegation in order to automate generation of wrappers like Foo.
>> 2. Lack of MI, because one base type is required and used further extension
>> of the target type becomes practically impossible.
> 
> Frequently overlooked, I think, Ada has nested scopes, useful
> in many ways here.

This is an unrelated issue. Referential semantics is not necessarily about
object life time management. Surely a better support provided by Ada for
stack allocated objects eliminates some cases of smart pointers typical in
C++. But the problem of referential objects exists independently on that.

Yes, if Ada had abstract access types, the positions 1 and 2 would be not
needed in this concrete case, because built-in access types in Ada already
"delegate" to the target, when operation "." is used. But Ada lacks
abstract access types either.

See last month's discussion: "Run-time accessibility checks (was:
Construction initialization problem)"

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



  reply	other threads:[~2009-01-16 12:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 10:04 smart pointer dangerous (no -> operator) Oliver Kowalke
2009-01-16 11:09 ` Dmitry A. Kazakov
2009-01-16 11:42   ` Georg Bauhaus
2009-01-16 12:43     ` Dmitry A. Kazakov [this message]
2009-01-16 21:21     ` Maciej Sobczak
2009-01-17 19:07       ` Georg Bauhaus
2009-01-16 11:46   ` Oliver Kowalke
2009-01-16 12:45     ` Dmitry A. Kazakov
2009-01-17  0:43   ` Brian Drummond
2009-01-17  9:28     ` Dmitry A. Kazakov
2009-01-16 20:08 ` Tero Koskinen
2009-01-16 21:16   ` Maciej Sobczak
2009-01-18 12:21 ` Samuel Tardieu
replies disabled

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