lua-users home
lua-l archive

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


Thanks for your reply. Actually I had tried venv already when I
started this project, but for a different reason. Part of the
experiment is to be able to run a whole bunch of scripts concurrently,
and those scripts are assumed to be "hostile" so the plan was to run
those each in their own environment too (this is why I'd like the
editor.. how cool is that, if users can write their scripts from
within the same app, with syntax highlighting and code folding and the
whole shebang... of course it can always be run separately but that's
not quite *as* cool :P).

Anyway, the problem I encountered then, is the same I got just now
when I tried it again. As soon as I call venv(MyFunction), everything
halts. I have to hit ctrl-c a couple of times just to exit Lua. I've
tried it with and without strict.lua, and with and without any other
modules/libraries (such as wxLua), it simply won't budge.

I've used venv before. As in, a couple of years ago (think it was venv
1.0, now I have venv 1.1 though), and it seemed to work then. But this
time, when it didn't work, I never looked further into it. I figured I
would just use setfenv... heh... Btw I use a precompiled binary of Lua
5.1.2, in case that matters.

Anyway, I look at the venv script and see a lot of code, and I know
it's ultimately based on setfenv. But it's not really clear to me what
the advantage is supposed to be over the couple lines of code in my
previous post?

Haven't tried Rings yet. Might check it out, looks cool. Will keep you informed.


On 31/01/2008, Mildred <> wrote:
> Hi,
> You may want to try VEnv from the Kepler Project:
> Else, I think it is a wxLua issue ... But I don't know.
> If this doesn't work, you can still use Rings to create another Lua
> state (and this runs on plain lua). There you are sure there is a
> strict separation ... but it may require the wxLua module to be able
> to be initialized twice.
> Try it out and tell us if it worked, I would like to know too.
> Mildred
> --
> Mildred Ki'lya
> E-Mail: mildred593(at)
> Site:   <>
> XMPP:   <> (GoogleTalk, Jabber)
> GPG:    197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]