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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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,UTF8 Received: by 10.66.85.226 with SMTP id k2mr1496324paz.34.1343315022650; Thu, 26 Jul 2012 08:03:42 -0700 (PDT) Path: b9ni61428159pbl.0!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!backlog2.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news2.arglkargh.de!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Fri, 20 Jul 2012 04:30:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> <72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com> <1uli63mb1e82x.11cuz41guddr5.dlg@40tude.net> NNTP-Posting-Host: 195.182.34.201 Mime-Version: 1.0 X-Trace: posting.google.com 1342784779 27438 127.0.0.1 (20 Jul 2012 11:46:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 20 Jul 2012 11:46:19 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <1uli63mb1e82x.11cuz41guddr5.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=195.182.34.201; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Original-Bytes: 3600 X-Received-Bytes: 3883 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: 2012-07-20T04:30:27-07:00 List-Id: W dniu pi=C4=85tek, 20 lipca 2012 10:27:15 UTC+2 u=C5=BCytkownik Dmitry A. = Kazakov napisa=C5=82: > The problem is that a *new* limited object cannot be result of a function= , > this is conceptually broken. Yes, we have already concluded long time ago that one of the priorities for= Ada is to fix the concept of object construction. But in this case I think= that Ada has everything that is needed. > The factory of limited objects passed to > Insert must provide means to: >=20 > 1. determine the constraints of the object (using some set of arguments); This is not the container's business and will usually come with the factory= itself - or from the context of the factory. That is why I expect this to = be used with access to *local* functions, which can drag along all the info= rmation that is needed to construct the object. > 2. construct the object in place (using the arguments again); Same as above - the constructor function can bring the "arguments" from its= surrounding context. You can even create wrappers like this: procedure Insert_From_Arguments (C : in out Container; X : in Integer; Y : in Integer; Z : in Integer) is function Construct return T is begin return V : T do V.X :=3D X; -- constructing T from arguments X, Y, Z -- ... end return; end Construct; begin C.Insert (Construct'Access); end Insert_From_Arguments; Above, the arguments are passed as part of the Construct's environment. > 3. optionally, construct the class-wide object upon the specific object > (using the arguments) I expect that class-wide is what the container sees (for example, by being = instantiated with such a type) - the rest happens the usual way, by initial= izing the class-wide placeholder with specific constructed object. This way= you could naturally have a container of OO objects. > 1-3 cannot be effectively fused into single operation Why? What's wrong (ie. what is ineffective) with the above? --=20 Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com