[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: for end
- From: Roberto Ierusalimschy <rieru@<a href="/cgi-bin/echo.cgi?delirius.cs.uiuc.edu">...</a>>
- Date: Fri, 15 Feb 2002 10:49:06 -0600 (CST)
On Fri, 15 Feb 2002, Markus Huber wrote:
> Is this an official behaviour also in future Lua versions?
> for Loop=0,1,-1 do
> print('Never') --> not executed
> print('Ready') --> 'Ready'
You mean, not running the body when the initial value is already "past" the
final one? Yes, is this is an official behavior.
> And is the old rule also correct with Lua: that code in the for loop
> reduces the speed of the loop massively?
Not at all. Code inside the loop only reduces the loop speep by the time
the code itself takes to run. (Unless the code inside the loop is really
huge, and then you may get some problems with paging??)