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,8e11100f675ea2df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.82.98 with SMTP id h2mr12744758pay.3.1357928079873; Fri, 11 Jan 2013 10:14:39 -0800 (PST) MIME-Version: 1.0 Path: 6ni101701pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!news.snarked.org!feeder.erje.net!us.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: asynchronous task communication Date: Tue, 8 Jan 2013 16:11:07 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1c2dnd5E6PMDR33NnZ2dnUVZ_sednZ2d@earthlink.com><7cudnYloBfQDw3_NnZ2dnUVZ_rKdnZ2d@earthlink.com><6bqdndEYjoxeGHnNnZ2dnUVZ_sadnZ2d@earthlink.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1357683071 31128 69.95.181.76 (8 Jan 2013 22:11:11 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 8 Jan 2013 22:11:11 +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: 2013-01-08T16:11:07-06:00 List-Id: "Simon Wright" wrote in message news:lyvcb7v0lk.fsf@pushface.org... > Jeffrey Carter writes: > >> On 01/08/2013 11:18 AM, Simon Wright wrote: >>> Jeffrey Carter writes: >>> >>>> If you have an item in your (unbounded) array, indexed by Positive, at >>>> index 3, it will still be at index 3 if you assign to components at >>>> other indices, or extend the array by adding new components beyond the >>>> current end of the array. However, if you insert a new component >>>> before the existing item at index 3, then all the components after the >>>> new component will shift up, and the existing item will then be at >>>> index 4. >>>> >>>> One would think that a Cursor would behave similarly. >>> >>> Not so! The Cursor becomes ambiguous[1], and using it is a bounded >>> error. GNAT GPL 2012 implements Cursor using an Index, & behaves the way >>> you'd expect. >> >> To my mind, that is Cursor behaving similarly. Just as the index 3 is >> no longer the index of the item in question, so the Cursor should not >> be relied on. > > In AdaCore's implementation, yes. But another implementation might > validly raise PE. To my mind, that'd be preferable. That's what Janus/Ada will do (whenever I get the containers written). It's actually fairly cheap to check, and it's silly to allow a bug to go undetected if it can be detected without too much expense. It's not possible to check indexes, of course, so this will be an advantage to using cursors. (But usually you use a vector rather than a list because you need computability of indexes, which of course you can't do with cursors.) Randy.