lua-users home
lua-l archive

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


> How does one achieve pass-by-value of lua functions arguments?

Pass-by-value is the only way for everything except tables, or do I
misunderstand
the question?

g=math.sqrt
function myfunc(f) return f(1)+f(4) end
print(myfunc(g)) --> 3