comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: High-Integrity OO and controlled types
Date: Tue, 3 May 2011 18:28:11 +0200
Date: 2011-05-03T18:28:10+02:00	[thread overview]
Message-ID: <1ds39akl3dbii$.mlyj7piip5o3.dlg@40tude.net> (raw)
In-Reply-To: 4dc01dca$0$6885$9b4e6d93@newsspool2.arcor-online.net

On Tue, 03 May 2011 17:22:50 +0200, Georg Bauhaus wrote:

> On 03.05.11 14:27, Dmitry A. Kazakov wrote:
>> On Tue, 03 May 2011 13:28:12 +0200, Georg Bauhaus wrote:
>> 
>>> On 03.05.11 11:59, Maciej Sobczak wrote:
>>>
>>>> Another angle: the fact that the lack of controlled types in HI
>>>> profiles can be considered as a problem is entirely a result of the
>>>> fact that Ada completely screwed this aspect at the beginning.
>>>> Controlledness should not be based on tags - it should be a completely
>>>> orthogonal property of the type,
>>>
>>> Actually, in non-flat languages like Ada, scope exit
>>> actions should be based on scopes, not (just) types,
>>> as types can effectively span multiple scopes.
>> 
>> But typed languages tend to consider actions as operations defined on
>> types, with certain contracts, reusable, clearly bound effects etc.
>> 
>> Actions as amorphous chunks of code tossed here and there depending on
>> scope is a way different ["anisotropic"] approach. In particular it does
>> not fit into safe modular software design, because of this "anisotropy".
> 
> What will type-object/module code look like if it is equivalent
> to its nested analog?  Better?

Analogue of what? The point is that "finally" cannot replace initialization
and finalization of objects, specific or class-wide.

The opposite is wrong. Any example where "finally" might be useful is
motivated by improperly designed types, e.g. File_Type, which does not
close itself upon destruction.

> My guess is that to achieve the necessary linking, one passes
> Italian food handles to constructors and/or established registries
> that receive "events" like "a scope X has been left".

See above, you need not to handle scopes. Scopes are ad-hoc, used for the
purpose of defining the lifespan of some objects. Leaving scope is as event
as leaving loop, leaving the else alternative of an if etc. If you need
such events re-design!

> For example, assuming something like the naturally nested
> Integrate function.

BTW, integrating function is an object. For this object the compiler
generates finalization, which in particular kills the closure. Care to show
how to do this using "finally"?

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



  reply	other threads:[~2011-05-03 16:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-01 20:38 High-Integrity OO and controlled types Maciej Sobczak
2011-05-01 21:29 ` Robert A Duff
2011-05-01 22:44   ` Simon Wright
2011-05-02  7:59   ` Dmitry A. Kazakov
2011-05-02 16:32     ` Robert A Duff
2011-05-02 19:39       ` Dmitry A. Kazakov
2011-05-03  0:08         ` Robert A Duff
2011-05-03  7:30           ` Dmitry A. Kazakov
2011-05-03 16:51             ` Robert A Duff
2011-05-02  9:50 ` Cyrille
2011-05-02 10:01   ` Cyrille
2011-05-02 19:25     ` Maciej Sobczak
2011-05-03  9:32       ` Cyrille
2011-05-03  9:59         ` Maciej Sobczak
2011-05-03 10:24           ` Dmitry A. Kazakov
2011-05-03 16:53             ` Robert A Duff
2011-05-03 17:37               ` Dmitry A. Kazakov
2011-05-03 11:28           ` Georg Bauhaus
2011-05-03 12:27             ` Dmitry A. Kazakov
2011-05-03 15:22               ` Georg Bauhaus
2011-05-03 16:28                 ` Dmitry A. Kazakov [this message]
2011-05-04  8:48                   ` Georg Bauhaus
2011-05-04  9:28                     ` Dmitry A. Kazakov
2011-05-04 14:46                       ` Georg Bauhaus
2011-05-04 15:01                         ` Dmitry A. Kazakov
2011-05-04 15:25                           ` Georg Bauhaus
2011-05-04 16:23                             ` Dmitry A. Kazakov
2011-05-04 17:06                               ` Georg Bauhaus
2011-05-04 20:16                                 ` Dmitry A. Kazakov
2011-05-05  7:13                                   ` Maciej Sobczak
2011-05-05 10:58                                     ` Cyrille
2011-05-05 12:35                                       ` Dmitry A. Kazakov
replies disabled

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