lua-users home
lua-l archive

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


On Tue, Jul 15, 2008 at 11:19 AM, Michael Gerbracht <smartmails@arcor.de> wrote:
> function call(f,n)
>  x = 5
>  y = loadstring("return "..f)
>  z = y()
>  print(z)
> end
>
> call("add(n)",12)

It doesn't work as you expect, because in the compiled string 'n' is
not bound to the parameter you passed, it tries to look it up
globally.

steve d.