Change the name of ArrayBoundsException in druntime

Denis Koroskin 2korden at gmail.com
Sat Nov 1 03:30:59 PDT 2008


On Sat, 01 Nov 2008 01:56:49 +0300, Sean Kelly <sean at invisibleduck.org>  
wrote:

> Andrei Alexandrescu wrote:
>> Sergey Gromov wrote:
>>> Wed, 22 Oct 2008 12:01:36 -0700,
>>> Sean Kelly wrote:
>>>> And as for ArrayBoundsException... how about IndexOutOfBoundsError.  
>>>> It's long, but probably the most self-explanatory.  Also, any value  
>>>> in retaining ArrayBoundsError and having it subclass this?  I'd think  
>>>> not, but figured I'd ask anyway.
>>>
>>> Maybe IndexingError ?  There are not necessarily any bounds when  
>>> you're indexing into an arbitrary collection.
>>  STL has range_error. I like that because it's rather general.
>
> The terminology matches D's new range concept anyway, which is a nice  
> perk.  Works for me.
>
>
> Sean

I find range_error way too generic. What is range error? Invalid range?
OutOfRangeError is more suitable imo.

Range!(int) r = ...; // random-access range
int t = r[2]; // okay, within range
int s = r[100]; // error, our of range



More information about the Digitalmars-d mailing list