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.4 required=5.0 tests=BAYES_00,MISSING_FROM, MISSING_MID,MISSING_SUBJECT 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-7-bit Received: by 10.68.241.162 with SMTP id wj2mr406677pbc.2.1343315201253; Thu, 26 Jul 2012 08:06:41 -0700 (PDT) Date: 2012-07-26T08:06:41-07:00 List-Id: Message-ID: <20120726150641.dfon0X32uQBUlb_8NAi58CjKyrb1QUHjF0sZHRT-nUc@z> Thu, 26 Jul 2012 08: 06:41 -0700 (PDT) Thu, 26 Jul 2012 08:06:40 -0700 (PDT) MIME-Version: 1.0 Path: p10ni64698300pbh.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!q21no3655192qas.0!news-out.google.com!a15ni105485768qag.0!nntp.google.com!q21no17643801qas.0!news-out.google.com!b9ni64983258pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news-2.dfn.de!news.dfn.de!feeder.erje.net!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: Thu, 19 Jul 2012 21:41:46 -0500 Organization: Jacob Sparre Andersen Research & Innovation Lines: 66 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> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1342752108 16361 69.95.181.76 (20 Jul 2012 02:41:48 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 20 Jul 2012 02:41:48 +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 Bytes: 4075 X-Received-Bytes: 4600 "Maciej Sobczak" wrote in message news:7308644e-bfbe-44c1-8359-d67392d483e1@googlegroups.com... W dniu czwartek, 19 lipca 2012 08:53:35 UTC+2 uzytkownik Randy Brukardt napisal: >> (With the obvious exception that "limited" almost never is >> really what you >> want in Ada, > >I disagree. Limited is a very frequent case - this seems to be very much in >the Ada spirit, which > in many places promotes reduction of available operations in order to ease > analysis and increase > safety. Sure, it's frequent. But it's still not what you *really* want, because you almost always need some copying. You just want that copying to be destructive (that is a move) or a creator (making a new object) or as a cloner (making a copy that acts as if it is the original). For example, you can't put limited objects into containers. We spent quite a bit of mental energy trying to come up with some way to do so, but eventually it proved futile, because you need some sort of copy to get the objects into (and something out of) the container. Which means that you can't let Ada do the storage management for you (as in the containers); you have to use explicit access types. That's a huge step backwards. > Note also that protected objects are limited by nature and in Ada 2005 > that fact has to > play well with interfaces, and so on. Well, I think interfaces are useless, and this is a reason. :-) As for protected objects, that is why we tried so hard to make containers for limited objects. But it can't be done in any general way. So you have to resort to 1980's programming to use them. Almost every protected object I've ever used has been a global object (usually a queue or lock). And that's in part because you can't make usable data structures out of them. >> clever use of Adjust fixes > >If you have to be *clever* to *fix* something and make it kinda sorta work, >then this is just > hacking around and has little to do with software engineering. And the alternative is to fill your program with raw access types and Unchecked_Deallocation. And *that* has little to do with software engineering. As I said to Dmitry, the problem isn't so much that you don't have uses for limited types, the problem is that neither "no-copying" nor "free-copying" is appropriate for most such types. The majority of types I've written fit into neither box. And there are no other choices possible in Ada. So you have to be *clever* in some way in order to fit the types into the boxes Ada gives you. And note that I don't have an answer here, only a problem. 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. Randy.