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: 103376,4608b6f4718e680f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.191.225 with SMTP id hb1mr719596pbc.5.1336516158967; Tue, 08 May 2012 15:29:18 -0700 (PDT) MIME-Version: 1.0 Path: pr3ni3898pbb.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!news.tornevall.net!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Problem in "X (1).Re := X (1).Re + 1" Date: Tue, 8 May 2012 17:29:14 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <13177506.38.1336222539273.JavaMail.geo-discussion-forums@pbtg6> <21452734.731.1336405064187.JavaMail.geo-discussion-forums@ynbv35> <5749033.1275.1336416838264.JavaMail.geo-discussion-forums@pbchd7> <10294366.7.1336426132700.JavaMail.geo-discussion-forums@yngg23> <5209872.2691.1336497260879.JavaMail.geo-discussion-forums@ynlq12> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1336516157 10780 69.95.181.76 (8 May 2012 22:29:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 8 May 2012 22:29:17 +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-05-08T17:29:14-05:00 List-Id: "Adam Beneschan" wrote in message news:5209872.2691.1336497260879.JavaMail.geo-discussion-forums@ynlq12... ... >In fact, looking into this further, I think there's a problem with the AARM >in this regard. >A.18.2(254.a), which was from Ada 2005, says "an implementation that >avoided copying >until one of the containers is modified would be allowed". It seems to me >that this is no longer >true. I'm going to send something to Ada-Comment about this. I think it is true, it's just that creating a reference (or for that matter, calling Query_Element) has to be dealt with specially; they're both somewhat like modifying an element. Query_Element is a bit less of a problem as most ways (but not all) to modify the container while the call is active are invalid. But it seems that the same problems can come up for it. (Note that a copy-on-write implementation is not a good idea for the standard containers for other reasons as well, the main one being that the usual uses don't create many copies, so having overhead for that can't be justified. But it should be possible to create a container with that semantics.) Randy.