lua-users home
lua-l archive

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


>local i = 1
>while i<=MAX do
>obj:f(a.b.c.d[i])
>i = i+1
>end
>
>can be rewritten as
>
>local i = 1
>local t = a.b.c.d
>local f = obj.f
>while i<=MAX do
>f(obj, t[i])
>i = i+1
>end

Assumming f doesn't effect a, b, c or d, of course.

Steve