[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Indirect call to function and passing arguments
- From: "steve donovan" <steve.j.donovan@...>
- Date: Tue, 15 Jul 2008 11:31:37 +0200
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.