Hardware description languages have composite types that can be indexed over any range. When most operations are unordered and apply to the whole array at once, who honestly cares what the base is?
Doesn't anyone else get tired of typing
for (i = 0; i < sizeof(x); i++) all the time instead of
for (e in x)? Even C compilers are expected to transform loops now; there's no reason for it to exist anymore.
>>4
I hope you mean to start at
n and decrement while testing for zero. This is usually more ``natural'' from the machine's point of view.
>>23
You don't want to have to do that in your language.
This is so very true. Even in C, returning an error code in band is almost never the right thing to do. Even if you can't currently think of a case where the range of the function could contain the sentinel value, it's very likely that you will later. Better to just use an out parameter and return 0 if you can't immediately think of a failure case.