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.181.12.35 with SMTP id en3mr2797247wid.2.1357902852125; Fri, 11 Jan 2013 03:14:12 -0800 (PST) Path: i11ni357624wiw.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.11.MISMATCH!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.x-privat.org!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: asynchronous task communication Date: Tue, 08 Jan 2013 18:18:44 +0000 Organization: A noiseless patient Spider Message-ID: References: <1c2dnd5E6PMDR33NnZ2dnUVZ_sednZ2d@earthlink.com> <50e18094$0$6583$9b4e6d93@newsspool3.arcor-online.net> <7NednS4s2oukfXzNnZ2dnUVZ_oadnZ2d@earthlink.com> <7cudnYloBfQDw3_NnZ2dnUVZ_rKdnZ2d@earthlink.com> <6bqdndEYjoxeGHnNnZ2dnUVZ_sadnZ2d@earthlink.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="585248293da7adcafb924c79c19cf5ec"; logging-data="11363"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rJk5XRDryAAzMVNLheQmzS94lZWjHrss=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:D79T8r2REOa0rjrZCdXrDpDQV5M= sha1:AFEKzAQxmNoTXjBqdat8cdUvspc= Content-Type: text/plain Date: 2013-01-08T18:18:44+00:00 List-Id: Jeffrey Carter writes: > On 01/08/2013 05:02 AM, Brian Drummond wrote: >> So, holding onto a cursor would be unsafe (i.e. no longer refer to the >> original object) after an "insert" operation, possibly earlier in the >> vector? > > 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. > > This should be pretty obvious if you think about how you would > implement an unbounded array. > > 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. [1] http://www.ada-auth.org/standards/12rm/html/RM-A-18-2.html#p240