comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Building limited types through nested creator functions
Date: Tue, 7 Feb 2012 14:25:40 +0100
Date: 2012-02-07T14:25:40+01:00	[thread overview]
Message-ID: <s50srnaxvrg2.70fkcygz6o69.dlg@40tude.net> (raw)
In-Reply-To: 4f3103b9$0$6560$9b4e6d93@newsspool4.arcor-online.net

On Tue, 07 Feb 2012 11:58:01 +0100, Georg Bauhaus wrote:

> On 07.02.12 10:10, Dmitry A. Kazakov wrote:
> 
>> The problem is that constructing functions of Ada are no replacement to
>> constructors, especially not with limited types.
> 
> Won't constructors have the same issue with limited private types
> and no copying?

The problem is specific to functions. A function returns a newly created
object, fully operational with all bells and whistles. This contradicts to:

1. limited types (non-copyable)
2. abstract types (no instances)
3. information hiding and partially operational objects

Constructor copies nothing. It is never called explicitly. No need to worry
about visibility issues. It does not promise or expose things which never
should come into existence (like creation of an abstract object). It does
not allocate memory, so it is much easier to roll back. It is much simpler
and, for all, a sound model which cannot be properly annotated with types.

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



  reply	other threads:[~2012-02-07 13:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 22:03 Building limited types through nested creator functions Simon Belmont
2012-02-06 12:44 ` Julian Leyh
2012-02-06 19:11 ` Shark8
2012-02-06 22:33   ` Simon Belmont
2012-02-07  0:03 ` Adam Beneschan
2012-02-07  0:27   ` Simon Belmont
2012-02-07  0:53     ` Adam Beneschan
2012-02-07  2:19       ` Simon Belmont
2012-02-07  9:10         ` Dmitry A. Kazakov
2012-02-07 10:58           ` Georg Bauhaus
2012-02-07 13:25             ` Dmitry A. Kazakov [this message]
2012-02-07 14:43               ` Yannick Duchêne (Hibou57)
2012-02-07 15:08                 ` Dmitry A. Kazakov
2012-02-07 17:04 ` Robert A Duff
replies disabled

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