lua-users home
lua-l archive

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


On Thu, Jun 16, 2011 at 9:04 AM, joao lobato <btnfdp.lobato@gmail.com> wrote:
> You can define a function like this:
> function f(_ENV, a, b)
>  print(a,b)
> end
>
> and call it like this:
> env = {print = function(...) print('myprint',...) end}
> f(env,1,2)
>
> Isn't it enough?

We're talking about foreign code loaded through lua_load or in Lua
load[string]().

-- 
- Patrick Donnelly