lua-users home
lua-l archive

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


On Fri, Mar 11, 2011 at 03:11:03PM -0800, Dimiter malkia Stanev wrote:
> Hm... I think I was not able to get that working with local functions, 
> but if it works with globals then no problem (later I can make them local).

In Ruben's example both f() and g() are globals, and the lookup for
those doesn't occur until the function is called.

If you want to do local you just need to create the varibles first:

local f, g
f = function(x) return g(x) end
g = function(x) print (x) end

print(f(30))


James Graves