From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee887b7593f7961b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.freenet.de!news.tu-darmstadt.de!newsfeed.velia.net!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada OS based on Minix3 Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1pmkcuemqczer.j2i34pvc2lne$.dlg@40tude.net> <81912719-8c66-439d-a40e-529b22acd8a6@u29g2000pro.googlegroups.com> <14t6hwu8udm8j$.1x339y69m2ew1.dlg@40tude.net> <14ay3vz2ngj9s.1bmilwgckl3lc$.dlg@40tude.net> Date: Sat, 15 Nov 2008 11:04:08 +0100 Message-ID: NNTP-Posting-Date: 15 Nov 2008 11:04:10 CET NNTP-Posting-Host: f8cb1fba.newsspool4.arcor-online.net X-Trace: DXC=8@]hgndVGaYU6b:FjPaGjQ4IUK On Fri, 14 Nov 2008 18:11:34 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" 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