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: a07f3367d7,735c710b5e547bad X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.224.174.74 with SMTP id s10mr1476778qaz.1.1343316397128; Thu, 26 Jul 2012 08:26:37 -0700 (PDT) Received: by 10.66.77.199 with SMTP id u7mr1643819paw.25.1343315597166; Thu, 26 Jul 2012 08:13:17 -0700 (PDT) Path: a15ni113198934qag.0!nntp.google.com!q21no5901972qas.0!news-out.google.com!p10ni65010571pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-peer1!btnet!zen.net.uk!hamilton.zen.co.uk!xlned.com!feeder5.xlned.com!ramfeed-1.ams.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.straub-nv.de!news.antakira.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Sun, 22 Jul 2012 11:34:54 +0200 Organization: cbb software GmbH Message-ID: <1vo4e4w755jum.1fef1su5i3sac$.dlg@40tude.net> References: <1arp60wtxes8h$.1qs6bt732ztgp.dlg@40tude.net> <030cde76-7435-405d-9f12-ac7f730ecab8@googlegroups.com> <1f9q6vk5z2r3t$.1hayo9rmxfwu7$.dlg@40tude.net> <7308644e-bfbe-44c1-8359-d67392d483e1@googlegroups.com> <1dgc6c6mortfo$.sdphq83df7gu$.dlg@40tude.net> <18usgh1w2ngg.18qc1w5q89um4.dlg@40tude.net> <1l1qasqzwtsof.18orc7p6s7hwz$.dlg@40tude.net> <1kfm6rhasv1hy.9ga3thjxlie8$.dlg@40tude.net> <1k3eqp61flhso$.ytgqehw2zf5d.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-5" Content-Transfer-Encoding: 8bit Date: 2012-07-22T11:34:54+02:00 List-Id: On Sun, 22 Jul 2012 13:06:17 +0400, Vasiliy Molostov wrote: > Dmitry A. Kazakov �����(�) � ����� ������ Sun, > 22 Jul 2012 12:19:20 +0400: > >>>> Initialization does on the object's value/state. >>> >>> Before you told that this one converts from raw memory into well formed >>> typed object. >> >> Yes. It is a type conversion: none -> a type > > Since you have considered that initialisation is the same as construction, > I suppose you agree. Initialization can be a part of construction. It is not same and applies to different aspects of the object: value vs. type [+/-value]. >>> I suppose that setting up state/value of raw memory can completely >>> define >>> any typed object. >> >> Accompanied by setting the designated type. Initialization is a part of >> construction. > > How do you setup compile-time designators in run-time? By applying a constructor. > "designated type" > is a compilation time syntax rule helping translator to distinguish type > of the object and which differs from source code context where used. I don't understand this. In a typed language any object has a type. > Perhaps, you tend to define type of the object outside of the memory it > holds. I don't understand this either. Certainly type is a part of program semantics and thus cannot be inside the object. > The way Ada goes is to minimize run-time execution and memory that hold by > objects, via evaluating them before, e.g. in compile-time. Objects cannot be evaluated at compile time, they are run-time entities. Values can be. But I don't understand your point. > Also, Ada is a procedural language. Rather it supports procedural decomposition. > Also, It is not clear why not to return a pointer (access reference) to > the object instead? Instead of what? A pointer is an object too. As such it requires construction. E.g. in Ada all pointers are constructed initialized by null if not explicitly set otherwise by the programmer. Furthermore, a pointer if not dangled, must point to an object, again constructed. I don't see how pointers may help the problem of construction. Regarding limited objects, pointers usually do things only worse. You should write instead of return (... some complicated not working aggregate ...); this return new T'(... the same messy aggregate ...); But in reality it might quickly become as bad as: return P ((S (new T'(...)).all)'Unchecked_Access); with practically no chance to get through the compiler, even if legal. Actually nobody, even all Ada language lawyer together, could tell if the mess were legal or not. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de