[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implementing a simple sandbox -- another quirk
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 24 Jun 2003 08:26:34 -0300
>Sorry, for being dumb, but the following still prints nil:
[...]
>function equals()
> return DATE
>end
[...]
>f = loadstring("return function() return equals() end")
>xxx(f)
That's because equals still has the old env. setfenv(x,f) does not affect
the env of equals. I'm sorry, using setfenv can defy intutition, as Wim has
described in http://lua-users.org/lists/lua-l/2003-02/msg00547.html .
--lhf