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,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.15.228 with SMTP id a4mr503374pbd.4.1316659972422; Wed, 21 Sep 2011 19:52:52 -0700 (PDT) MIME-Version: 1.0 Path: lh7ni2256pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Wed, 21 Sep 2011 21:52:47 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <86015926-d652-4265-aedd-413312d399f9@dq7g2000vbb.googlegroups.com> <0d272f62-67d0-4905-972c-8a7e912c5531@en1g2000vbb.googlegroups.com> <148cxoyabima2.16mz6xwdph2hj.dlg@40tude.net> <01a1374f-59ab-40be-9e39-0640cb2a513d@n35g2000yqf.googlegroups.com> <1fp2o673mu9az$.d9loz1zbcl0d.dlg@40tude.net> <14tiipigyejtc$.hyp7e82egqwq$.dlg@40tude.net> <34d856bd-19a3-4bbf-b9d8-c0f100000ef4@k7g2000vbd.googlegroups.com> <1tpl2pc36ptr4$.txv4v3wmkjlm.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1316659970 2822 69.95.181.76 (22 Sep 2011 02:52:50 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 22 Sep 2011 02:52:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original Xref: news1.google.com comp.lang.ada:18072 Date: 2011-09-21T21:52:47-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1tpl2pc36ptr4$.txv4v3wmkjlm.dlg@40tude.net... ... >> Nobody is forcing referential semantics, although it might be the most >> natural and efficient solution for iterators. > > Of course it does, because the iterator refers to the container and to an > element in that container. Which is evidently fragile as any reference > when > the container and its element mutate. Fragile perhaps, but it is definitely possible to be safe (which is more important, IMHO). Ada.Containers are safe in this aspect, as any attempt to mutate the container ("tampering") is required to raise Program_Error. That's true as long as the iterator or reference exist. (Note that "tampering" only is an issue if the container is changed; it's not a problem for the individual element contents to be changed, which some exceptions having to do with discriminants or tags.) Randy.