[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Determining if _ENV is the first upvalue of a closure?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 13 Mar 2015 19:35:05 +0200
2015-03-13 18:48 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> I can imagine a scenario in which one would not want to expose actual
>> source code, but would be willing to provide an API naming the upvalues.
>
> The source code is present in a precompiled chunk only if the code is loaded
> with luaL_loadstring or plain load. By using luaL_loadbuffer or optional
> arguments in load, you can provide you own string for error messages
> instead of the source code.
I was thinking more of a situation in which the author of the function
is not willing to disclose the source code, and therefore provides
bytecode-only releases of his/her Lua software. Relying on conforming
behaviour at load time would not be adequate then.