A Refcounted Array Type

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 23 16:13:36 PST 2015


Walter Bright:

> 5. bounds checking

When you go past bounds of a built-in array you get an error 
located in the user code, while if you put a pre-condition in 
your Array struct to detect the same errors, you get a run-time 
error message located in that pre-condition instead. I'd like 
some way to solve this small problem of giving more correctly 
located error messages. In Contract programming lingo it's a 
problem of "blame management" (I'd also like a way to detect some 
compile-time out-of-bound errors for user-defined collections, 
but you said this is not worth the effort).

Bye,
bearophile


More information about the Digitalmars-d mailing list