[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: When step is zero in numeric for statement
- From: Brett Nash <nash@...>
- Date: Sun, 11 May 2008 21:18:10 +1000
On Sun, 2008-05-11 at 12:24 +0800, CHU Run-min wrote:
> for i = 10, 1, 0 do
>
> end
>
> This results in an endless loop. Why not check step for zero?
Since you can escape the loop through breaking, yielding, or other
mechanisms, it isn't necessarily fatal. It would be a rather unusual
language feature to throw an error in this case.
Regards,
nash