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,90108ed846e3f1bf X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Language lawyer question: task activation 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: <1dusr7frk73m7.nlsagplge0hk.dlg@40tude.net> <09a7aab3-d105-4a40-b25b-e2824cb12f89@j1g2000yqi.googlegroups.com> <24bdd0df-9554-49de-9c5e-99572c9cdf34@g38g2000yqd.googlegroups.com> <1v0f2pkso7p50.vein84avao5t.dlg@40tude.net> <499ede41$0$32665$9b4e6d93@newsspool2.arcor-online.net> <1lhxmo6l2ypux.bei2ffp1m3e$.dlg@40tude.net> <499f2c59$0$31868$9b4e6d93@newsspool3.arcor-online.net> Date: Sat, 21 Feb 2009 09:31:14 +0100 Message-ID: <1vcaimc8kjj30$.kf3rsd670ebp$.dlg@40tude.net> NNTP-Posting-Date: 21 Feb 2009 09:31:16 CET NNTP-Posting-Host: a28bef99.newsspool3.arcor-online.net X-Trace: DXC=;6:]ndKBP_3n`gW2MTm]<3McF=Q^Z^V384Fo<]lROoR1^YC2XCjHcb9k38cA]E6mc6DNcfSJ;bb[5IRnRBaCd;lK9@R;jLb3[8e>HC^Tob? X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3726 Date: 2009-02-21T09:31:16+01:00 List-Id: On Fri, 20 Feb 2009 23:19:04 +0100, Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > >> It neither computes nor assigns, because construction/initialization is not >> assignment. It is a different thing. The LHS object does not exist prior >> construction, but does prior assignment. >> >>> The word "in-place" is not in Ada, only "build-in-place". >>> >>> Then, a procedure returns, too. Consequently, a >>> function returning yields a value. >> >> What does it return? Note that it does return an object, that were illegal >> because the result is limited. > > I suppose it is just a wording question: When > a function returns, there is a yield. > > When a procedure P(Object: out T) returns, there > is a yield (in Object). No, it is not so. The actual of Object out T is constructed *prior* to call to P. In contrast the "actual" of F return T is not constructed (when T is limited). This is exactly the thing that worries me. Because it makes out T and return T different, while they are evidently same. > Assume the following language experiment: > If T is limited, we might write > > X: constant T; > > begin -- not Ada > > T'Initialize(X, Celsius => 27.3); > > or some such, with the understanding that the object > named X will be provided by declaration, but will not > be initialized. Instead, it will have its initial > value when T'Initialize has returned. Unfortunately it is impossible to have pure "out". Again, because that is inconsistent in the same way the return statement is. You cannot pass an non-existing object to a subprogram, be it an out parameter or a result. The object simply does not exist, there is nothing to pass. In fact it is a kind of raw memory being passed. Worse than that it is rather an idea of raw memory, in the case of function result. > Initialization is very much part of object construction in > other languages, sometimes resource management is normally > left to the implementation, too, like in Java, or Eiffel. It must be clearly understood and *spelt* in the language, that initialization is not an assignment. Initialization cannot be implemented by any operation defined on the type of the object being initialized. Period. If you want to do it *consistently* (typed), you have to decompose initialization into operations of *other* types. But it remains still impossible without some magic, called "constructor." The best thing you can do is to allow some hooks in the constructor to be implemented by user-defined operations. A constructor of T as a whole is not an operation of T in any properly typed system. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de