lua-users home
lua-l archive

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


On Tuesday 25 October 2005 15:14, Jose Marin wrote:
[...]
> If I use luaL_loadstring, the string it's compiled,
> and the functions/global vars are inserted on the
> global environment.
>
> I don't wanna this.

I don't know luaL_loadstring --- do you mean luaL_loadbuffer? If so, it
shouldn't add anything to the environment (AFAIR) until the chunk that's
returned is actually executed.

OTOH, if you meant luaL_dostring, then that'll compile and then execute the
chunk, so yes, it'll modify its environment, which defaults to the global one.
But if you just want to do a syntax check you probably don't want to do this
(because the chunk may have side effects).

Alternatively, I could be completely misunderstanding you...

-- 
+- David Given --McQ-+ "I concluded from the beginning that this would be
|  dg@cowlark.com    | the end; and I am right, for it is not half over
| (dg@tao-group.com) | yet." --- Sir Boyle Roche
+- www.cowlark.com --+ 

Attachment: pgpi2k_yF7edS.pgp
Description: PGP signature