public static IEnumerable<int> range(int max)
{
if (max < 0) /* added for coherence with behavior of compiler-optimized
* for-in-range() loops, should compiler loops automatically
* inverse iteration in this case? */
{
throw new ArgumentOutOfRangeException("max < 0");
}
return range(0, max);
}