From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada OS based on Minix3
Date: Sat, 15 Nov 2008 11:04:08 +0100
Date: 2008-11-15T11:04:10+01:00 [thread overview]
Message-ID: <j5949itkj2fy$.xhhf37n829u7$.dlg@40tude.net> (raw)
In-Reply-To: wcc4p29x5qx.fsf@shell01.TheWorld.com
On Fri, 14 Nov 2008 18:11:34 -0500, Robert A Duff wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>
>> On Tue, 11 Nov 2008 17:09:54 -0500, Robert A Duff wrote:
>>> Initialization: Use function calls. They work for all types.
>>> I think we've discussed this idea before, but I don't remember
>>> any fundamental problems.
>>
>> The fundamental problem is that a constructor cannot be decomposed into
>> functions. In the function body you have to construct the object before you
>> return it. Who does it and what?
>
> In Ada 2005, a constructor function creates the object via another
> function call, or via an aggregate, or via an uninitialized
> variable (to which it assigns components).
Here we are. At the end of this chain there is always some magical
construct which is not a function. It is the construct which yields the
object of the type. The object is *already* constructed at this point, per
magic, not per function which is not yet even returned.
>> Under initialization I do not mean replacing a "default" value with
>> something else. I mean creation a new object (at some memory location)
>> initialized by a value. It had no other value before.
>
> That's exactly what a function call does:
>
> X : T := F(...);
>
> F creates a new object. In the limited case, that object _is_ X.
> In the nonlimited case, it gets copied into X. Either way,
> X has been turned from "raw bits" into an object of type T --
> as you say, "it had no other value before."
The "value before" is one set by the magical construct used within F. The
construct itself ultimately can neither be a function nor a procedure. F is
a factory function, merely a wrapper around allocator and some true
constructor.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2008-11-15 10:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-07 14:10 Ada OS based on Minix3 Cedric.Lannock
2008-11-07 16:20 ` xavier grave
2008-11-08 3:46 ` anon
2008-11-10 8:12 ` Ivan Levashew
2008-11-10 8:58 ` Dmitry A. Kazakov
2008-11-10 9:26 ` Ivan Levashew
2008-11-10 10:11 ` Georg Bauhaus
2008-11-10 10:24 ` Jacob Sparre Andersen
2008-11-10 10:51 ` Dmitry A. Kazakov
2008-11-10 11:07 ` Ludovic Brenta
2008-11-10 11:42 ` Ivan Levashew
2008-11-10 12:04 ` Ludovic Brenta
2008-11-11 22:16 ` Robert A Duff
2008-11-12 6:28 ` Ivan Levashew
2008-11-10 10:50 ` Ivan Levashew
2008-11-10 11:01 ` Dmitry A. Kazakov
2008-11-10 15:31 ` Robert A Duff
2008-11-10 15:56 ` Dmitry A. Kazakov
2008-11-11 22:09 ` Robert A Duff
2008-11-12 9:47 ` Dmitry A. Kazakov
2008-11-13 0:58 ` Randy Brukardt
2008-11-13 17:28 ` Dmitry A. Kazakov
2008-11-13 23:25 ` Randy Brukardt
2008-11-14 9:30 ` Dmitry A. Kazakov
2008-11-14 23:11 ` Robert A Duff
2008-11-15 10:04 ` Dmitry A. Kazakov [this message]
2008-11-15 11:57 ` Programmer controlled object creation (was: Re: Ada OS based on Minix3) Georg Bauhaus
2008-11-15 12:44 ` Programmer controlled object creation Dmitry A. Kazakov
2008-11-10 10:18 ` Ada OS based on Minix3 Georg Bauhaus
2008-11-11 1:00 ` Freejack
2008-11-11 8:32 ` Martin Krischik
2008-11-11 11:09 ` Peter C. Chapin
2008-11-11 11:59 ` Georg Bauhaus
2008-11-11 14:35 ` Ludovic Brenta
2008-11-11 16:49 ` Georg Bauhaus
2008-11-13 7:10 ` Martin Krischik
2008-11-13 7:01 ` Martin Krischik
2008-11-13 6:48 ` Martin Krischik
2008-11-13 8:09 ` Thomas Locke
2008-11-13 10:16 ` Alex R. Mosteo
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox