lua-users home
lua-l archive

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


Hi,

> Do you know how to call Lua functions recursively.
> Such as I have a Lua function
> 
> function gettable(t)
>[...]
>      gettable(value)
>[...]
> end
> 
> But I failed to recursively call gettable in gettable.
> Anyone can tell me how to call lua functions recursively ?

This should work.  The only case where this would not work is
if gettable was declared local.  Any way that there is a

	local gettable

somewhere above?  In that case the compiler will issue a warning
like "cannot access a variable in outer scope".

Ciao, ET.