comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: asynchronous task communication
Date: Tue, 8 Jan 2013 16:11:07 -0600
Date: 2013-01-08T16:11:07-06:00	[thread overview]
Message-ID: <kci5hv$uco$1@munin.nbi.dk> (raw)
In-Reply-To: lyvcb7v0lk.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyvcb7v0lk.fsf@pushface.org...
> Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org> writes:
>
>> On 01/08/2013 11:18 AM, Simon Wright wrote:
>>> Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org> 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.





  reply	other threads:[~2013-01-08 22:11 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31  0:16 asynchronous task communication Charles Hixson
2012-12-31  9:04 ` Simon Wright
2012-12-31 11:49   ` Simon Wright
2012-12-31 10:50 ` J-P. Rosen
2012-12-31 12:09 ` Georg Bauhaus
2012-12-31 18:52   ` Charles Hixson
2012-12-31 20:18     ` Shark8
2012-12-31 21:09     ` Niklas Holsti
2012-12-31 22:15       ` Randy Brukardt
2013-01-01  3:58         ` Charles Hixson
2013-01-01  4:48           ` tmoran
2013-01-01 17:59             ` Charles Hixson
2013-01-01  3:51       ` Charles Hixson
2013-01-01  9:59         ` Dmitry A. Kazakov
2013-01-01 10:38         ` Brian Drummond
2013-01-01 12:32         ` Jeffrey Carter
2013-01-01 18:21           ` Charles Hixson
2013-01-01 18:54             ` Robert A Duff
2013-01-02  7:36               ` Charles Hixson
2013-01-02  9:55                 ` Dmitry A. Kazakov
2013-01-02 19:02                   ` Charles Hixson
2013-01-02 20:35                     ` Dmitry A. Kazakov
2013-01-03  0:20                       ` Charles Hixson
2013-01-03  6:34                         ` Charles Hixson
2013-01-03  8:50                         ` Dmitry A. Kazakov
2013-01-03 19:01                           ` Charles Hixson
2013-01-03 10:01                         ` J-P. Rosen
2013-01-03 19:29                           ` Charles Hixson
2013-01-04  8:17                             ` J-P. Rosen
2013-01-05  4:31                               ` Charles Hixson
2013-01-09  8:34                                 ` Stephen Leake
2013-01-03 22:27                         ` Randy Brukardt
2013-01-05  5:18                           ` Charles Hixson
2013-01-05  8:48                             ` Niklas Holsti
2013-01-06 22:55                               ` Charles Hixson
2013-01-07  0:38                                 ` tmoran
2013-01-07  6:07                                 ` Shark8
2013-01-07 10:49                                 ` Brian Drummond
2013-01-07 18:27                                   ` Jeffrey Carter
2013-01-08 12:02                                     ` Brian Drummond
2013-01-08 17:12                                       ` Jeffrey Carter
2013-01-08 18:18                                         ` Simon Wright
2013-01-08 20:29                                           ` Dmitry A. Kazakov
2013-01-08 21:01                                           ` Jeffrey Carter
2013-01-08 21:14                                             ` Simon Wright
2013-01-08 22:11                                               ` Randy Brukardt [this message]
2013-01-08 22:52                                               ` Jeffrey Carter
2013-01-08 22:26                                         ` Brian Drummond
2013-01-08  2:41                             ` Randy Brukardt
2013-01-02 22:43         ` Niklas Holsti
2013-01-03  1:30           ` Charles Hixson
2013-01-03 12:11             ` Georg Bauhaus
2013-01-03 13:17               ` Dmitry A. Kazakov
2013-01-05 20:19               ` Charles Hixson
2013-01-07  4:01                 ` Shark8
2013-01-01 19:59     ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox