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.180.94.8 with SMTP id cy8mr2799484wib.1.1357902808526; Fri, 11 Jan 2013 03:13:28 -0800 (PST) Path: o9ni6591wio.1!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: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: asynchronous task communication Date: Tue, 08 Jan 2013 10:12:30 -0700 Organization: Also freenews.netfront.net; news.tornevall.net 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-Date: Tue, 8 Jan 2013 17:12:32 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="656ea2f23126f57fb36504d2d15a002c"; logging-data="16039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bNgD6dte1aNuR+8VFxrrYu7nodrft6eI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:nATsescsMOPOyQty7nxeRGrmbhA= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-01-08T10:12:30-07:00 List-Id: On 01/08/2013 05:02 AM, Brian Drummond wrote: > > And the index is a Cursor type. No. The index is a discrete type chosen by the user. Cursor is a private type defined by the package. Both serve to represent a "location" in the array. While it's clear that Cursor was included to make the package similar to the other containers, Cursor doesn't really make sense for the unbounded-array abstraction. > 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. -- Jeff Carter "Whatever it is, I'm against it." Horse Feathers 46