# [NTG-context] PANIC: unprotected error in call to Lua API

Hans Hagen pragma at wxs.nl
Fri Jan 14 19:15:49 CET 2011

```On 14-1-2011 5:51, Peter Münster wrote:
> Hans Hagen<pragma at wxs.nl>  writes:
>
>> On 14-1-2011 4:54, Peter Münster wrote:
>
>>> local t = {}
>>> package.seeall(t)
>>> setfenv(0, t)
>
>> what do you want to achieve with the first three lines
>
> I want to prevent pollution of the global environment, when I need to
> define my own globals. But of course, I can do that with a name-space
> prefix, that's what I'm doing now.
>
> I've just posted the error, because perhaps it reveals a bug somewhere.

in lua 5.2 the environment related mechanism will change a bit anyway so
best not depend on that now

Hans

-----------------------------------------------------------------