comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: another way to shoot yourself in the foot?
Date: Wed, 25 Jun 2008 12:32:05 +0200
Date: 2008-06-25T12:32:08+02:00	[thread overview]
Message-ID: <48621ea8$0$6556$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <1ilzy5ufjyn6p$.cu5078bqe0mj$.dlg@40tude.net>

Dmitry A. Kazakov schrieb:

>> And now automatic operations like Initialize and Finalize,
>> hooked on a single type (and possibly discriminants---does
>> GNAT like at last :-) are supposed to be the solution of
>> all data management?
> 
> Yes they are. Note that constructing/destructing hooks have different rules
> of composition, like aggregates and assignments have. They are not
> overridden they are extended. (Ada's Finalization is bogus, alas).

Just one point ad hoc.
Taking the notion of construction further, define the concept
of initialization.

In general, initialization of an object Obj_1 of type T1
may logically be related to the observable state of Obj_2
of type T2, where observable state means result of operations
or (component) values. As these states change while a
program is running, the dependences may not always be the same.

Obj_1's initialization may logically depend on

   F(Obj_1, ..., Obj_N),

or more generally on

   F(G_1(Obj_1_1, ..., Obj_M_1), ... G_J(Obj_1_J, ..., Obj_M_J)).

for some finite sets of objects and functions.
Basically, on anything that can be programmed into an expression
used for initializing. It may be cross unit, involve P98.T19 or not,
or A.B.T42 only if G_17(Obj_127) > 666 etc.

This "net of dependence" would mean that a constructor will have
to adjust its behavior to the current state of the program. Adjustment
may be realized through dispatching to a load of objects, other
constructors, etc. etc. etc.  IOW, every constructor becomes a huge
factory in disguise.  It has to perform case distinction.
How is this seemingly special construction different from just
normal programming?  The only added value of constructors that
I can see is that I can point to a few functions which "point to"
all this. A good addition, and not a small one. But should we
therefore abandon all other means of initializing things?

If construction turns out to be mostly normal programming, why
not use plain old language features in addition to specialized
constructor programming? For example, use local scopes and
visibility for providing (computed) initial values, even though
a scope is not an operation of a type, like a construtor function
is.



  reply	other threads:[~2008-06-25 10:32 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20  9:03 another way to shoot yourself in the foot? fedya_fedyakoff
2008-06-20  9:34 ` Dmitry A. Kazakov
2008-06-20  9:48   ` fedya_fedyakoff
2008-06-20 10:01     ` Ludovic Brenta
2008-06-20 10:05 ` christoph.grein
2008-06-20 10:26   ` Dmitry A. Kazakov
2008-06-20 16:12     ` Adam Beneschan
2008-06-20 15:48   ` Adam Beneschan
2008-06-20 19:27   ` Robert A Duff
2008-06-20 23:37     ` Jeffrey R. Carter
2008-06-21  8:56       ` Dmitry A. Kazakov
2008-06-22 20:44         ` Robert A Duff
2008-06-23  7:49           ` Dmitry A. Kazakov
2008-06-24  4:02             ` george.priv
2008-06-24  7:30               ` Dmitry A. Kazakov
2008-06-24 17:16                 ` Robert A Duff
2008-06-24 19:15                   ` Jeffrey R. Carter
2008-06-24 20:31                     ` Robert A Duff
2008-06-24 20:50                       ` Ludovic Brenta
2008-06-24 23:02                         ` Robert A Duff
2008-06-24 23:42                         ` Georg Bauhaus
2008-06-24 21:24                       ` Jeffrey R. Carter
2008-06-24 23:24                         ` Robert A Duff
2008-06-25 15:07                       ` Adam Beneschan
2008-06-24 14:59             ` Adam Beneschan
2008-06-24 16:41               ` Dmitry A. Kazakov
2008-06-24 17:20                 ` Robert A Duff
2008-06-24 17:52                   ` Dmitry A. Kazakov
2008-06-24 23:35                     ` Georg Bauhaus
2008-06-25  8:09                       ` Dmitry A. Kazakov
2008-06-25 10:32                         ` Georg Bauhaus [this message]
2008-06-25 12:06                           ` Dmitry A. Kazakov
2008-06-22 20:37       ` Robert A Duff
2008-06-22 21:25         ` Jeffrey R. Carter
2008-07-04 20:52           ` Colin Paul Gloster
2008-07-04 22:15             ` (see below)
2008-07-05 16:06               ` Colin Paul Gloster
2008-07-05 13:38             ` Gary Scott
2008-07-05 16:42               ` Colin Paul Gloster
2008-07-05 19:00                 ` Gary Scott
2008-07-09 19:39                   ` Colin Paul Gloster
2008-07-09 20:35                     ` Richard Maine
2008-07-09 22:49                       ` Terence
2008-07-10  1:07                         ` Gary Scott
2008-07-10 14:10                       ` Colin Paul Gloster
2008-07-10 14:57                         ` fj
2008-07-10 16:47                           ` Richard Maine
2008-07-10 17:03                         ` Dick Hendrickson
2008-07-10 17:26                           ` Craig Powers
2008-07-10 19:55                             ` James Giles
2008-07-10 20:45                               ` Dick Hendrickson
2008-07-10 21:22                                 ` Richard Maine
2008-07-10 21:29                                   ` Craig Powers
2008-07-10 20:45                               ` Craig Powers
2008-07-10 19:51                           ` James Giles
2008-07-11 15:02                             ` Colin Paul Gloster
replies disabled

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