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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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-7-bit Received: by 10.180.105.38 with SMTP id gj6mr1294591wib.0.1343313350331; Thu, 26 Jul 2012 07:35:50 -0700 (PDT) MIME-Version: 1.0 Path: q11ni75632405wiw.1!nntp.google.com!feed-C.news.volia.net!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!nntp.giganews.com!ramfeed-2.ams.xsnews.nl!feed.xsnews.nl!border-3.ams.xsnews.nl!newsfeed.straub-nv.de!news-2.dfn.de!news-1.dfn.de!news.dfn.de!feeder.erje.net!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Fri, 20 Jul 2012 19:12:44 -0500 Organization: Jacob Sparre Andersen Research & Innovation 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> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1342829572 13920 69.95.181.76 (21 Jul 2012 00:12:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 21 Jul 2012 00:12:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-07-20T19:12:44-05:00 List-Id: "Maciej Sobczak" wrote in message news:72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com... W dniu piatek, 20 lipca 2012 04:41:46 UTC+2 uzytkownik Randy Brukardt napisal: ... >> For example, you can't put limited objects into containers. > >Then we have poor containers. A group of us tried to come up with a workable design for limited containers and were unable to do so. >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); > >with intended support for downward closures via local and non-local >constructor functions. > T can be limited or even class-wide limited (which is even more useful). It would be obnoxious to use, as you'd have to write all manner of constructor functions and wrappers of the same. We thought Query_Element is too much of a pain to use, which is why Ada 2012 adds user-defined indexing and user-defined dereferencing so no one has to use those functions. I also believe that there other operations that would be problems -- but in any case, I don't remember the details of what we talked about years ago. ... >> I personally would rather be *clever* to *fix* something than to retreat >> into >> 1980's programming that cannot be done right by any technique. But >> your >> mileage may vary. > >My mileage is that we have to fix what is broken, instead of hacking around >it. That's the best option, but we couldn't do it. Perhaps we weren't clever enough! It's definitely the case that there are applications where limited is too limiting, and full non-limited is too hard to support. (Another problem is the inability to change limitedness within a hierarchy; you can't have limited descendants of non-limited types, or vice-versa. This essentially forces using non-limited in the whole hierarchy if it is needed at any level. This is necessary because of dispatching and conversions: if you can have mixed limited and non-limited types, you can always convert to a place where assignment is allowed. And then what?) Randy.