lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 08, 2004 at 06:12:05PM -0500, John Paquin wrote:
> To open a whole new can of worms...
> 
> Could this code be made faster by making "word" a local variable?
> 

It is no faster on my machine.  Which isn't surprising.  The manual says
that the loop variable is already local:

"The loop variable var is local to the statement; you cannot use its
value after the for ends or is broken. If you need the value of the loop
variable var, then assign it to another variable before breaking or
exiting the loop."

scott

-- 
------------------------------------------------------------------------
scott jacobs                                   scott+lua@escherichia.net
------------------------------------------------------------------------