I think Associative Array should throw Exception
James Blachly
james.blachly at gmail.com
Wed Sep 2 02:46:55 UTC 2020
On 9/1/20 2:55 PM, Steven Schveighoffer wrote:
> On 9/1/20 2:20 PM, Jesse Phillips wrote:
>
>> Using RangeError is nice as it allows code to use array index inside
>> `nothrow.`
>
> This is the big sticking point -- code that is nothrow would no longer
> be able to use AAs. It makes the idea, unfortunately, a non-starter.
...
> -Steve
Steve, are there not several (probably better, faster) alternatives to
the built-in AA that are nothrow? I think a nice way to look at the
built-in AA is an easy default for quick scripts, new users, etc., much
like the default of `throw` status of a function or code block.
Advanced users, (i.e. those using nothrow annotation) could select a
more efficient AA implementation anyway.
More information about the Digitalmars-d-learn
mailing list