lua-users home
lua-l archive

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


> local Loop = function( i )
>   [ loop code ]
>   if( i == %endvalue ) then
>     return
>   end
>   [ more loop code ]
>   Loop( i + %increment )
> end
> Loop( startvalue )

That would not work. Loop is local, so your recursive call should be %Loop. 
But Loop is not defined when the function is instantiated, so %Loop will be 
nil. You need something equivalent to "letrec" to do that. 

-- Roberto