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.216.61.65 with SMTP id v43mr2477091wec.6.1343313070678; Thu, 26 Jul 2012 07:31:10 -0700 (PDT) Path: ge7ni75591628wib.0!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news.swapon.de!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Fri, 20 Jul 2012 10:27:15 +0200 Organization: cbb software GmbH Message-ID: <1uli63mb1e82x.11cuz41guddr5.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> <72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com> 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-2" Content-Transfer-Encoding: 8bit Date: 2012-07-20T10:27:15+02:00 List-Id: On Fri, 20 Jul 2012 01:09:45 -0700 (PDT), Maciej Sobczak wrote: > W dniu pi�tek, 20 lipca 2012 04:41:46 UTC+2 u�ytkownik Randy Brukardt napisa�: > >> For example, you can't put limited objects into containers. > > Then we have poor containers. > > Let's take existing Query_Element-like operations for inspiration. What about: > > procedure Insert (C : in out Container; > Constructor : not null access function return T); The problem is that a *new* limited object cannot be result of a function, this is conceptually broken. The factory of limited objects passed to Insert must provide means to: 1. determine the constraints of the object (using some set of arguments); 2. construct the object in place (using the arguments again); 3. optionally, construct the class-wide object upon the specific object (using the arguments) 1-3 cannot be effectively fused into single operation, e.g. constructing function wrapping an aggregate. This is the root problem. P.S. I think you could probably go further with procedure Insert (C : in out Container; Constructor : not null access function return not null access T); But that is not we all wanted to get from a language like Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de