lua-users home
lua-l archive

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


Thanks for pointing to venv since it provides a nice roadmap for how to
aggressively sandbox stuff.

It doesn't, however, address the issue I was raising since when it does a
setfenv on the function to be wrapped, it will stomp any existing
environment. In particular, I can't write:

    f1 = venv( f )
    f2 = venv( f )

And have separate environments for the functions.

Mark

on 7/6/05 8:02 AM, Andre Carregal at carregal@fabricadigital.com.br wrote:

>> Mark Hamburg wrote
>> ...
>> Doing so involves modifying the function environment for the
>> methods in ThisClass so that they have appropriate definitions of next.
>> 
>> Note, however, that there isn't a way in Lua to duplicate a
>> function and give it a new environment which makes playing with function
>> environments a little bit risky.
> 
> I may be completely off mark here, but have you checked VEnv
> (http://www.keplerproject.org/venv/)?
> 
> VEnv offers a way to create a new environment to a function that inherits
> from the "outer" environment, but I'm not sure if this is what you are
> looking for.
> 
> André
>