Why exceptions for error handling is so important
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jan 12 12:58:14 PST 2015
On 1/12/2015 11:30 AM, Russel Winder via Digitalmars-d wrote:
> Go has an interesting solution, key lookup in a map return a pair
> (result, ok), if lookup succeeded then result is the associated value,
> if ok is false then result is undefined. I quite like this.
That's just putting the responsibility of array bounds checking on the caller.
Would you want (result, ok) returned every time you indexed an array? I sure
wouldn't. An associative array isn't conceptually any different.
More information about the Digitalmars-d
mailing list