Spec#, nullables and more

Walter Bright newshound2 at digitalmars.com
Sat Nov 6 11:17:12 PDT 2010


bearophile wrote:
>> Suppose, for example, you are appending the numbers 1..5 to the array, and 
>> somehow appended a 17. Many moons later, something crashes because the 17 was 
>> out of range.
> 
> This bug doesn't happen in Ada (and Delphi), because you define a ranged integer type like this:
> subtype Small is Integer range 1 .. 5;

Since you're the second to misunderstand me in the same way, I obviously wasn't 
very clear at all. Allow me to restate:

Suppose, for example, you are appending prime numbers to the array, and
somehow appended a 25. Many moons later, something crashes because the 25 was
not prime.


More information about the Digitalmars-d mailing list