lua-users home
lua-l archive

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


On Tue, Dec 11, 2012 at 12:25 PM, Peter Aronoff <telemachus@arpinum.org> wrote:
> On Tue Dec 11 2012 @  5:07, Roberto Ierusalimschy wrote:
>> In 5.2 the current output file is stored in the registry, so it is
>> easy to access it from outside the library. (Currently the key is not
>> exported in a .h file, but it is easy to copy it: "_IO_output".)
>
> Thank you for this. I'll definitely look.
>
> I would love still to hear from any and all about the larger issue (and for
> 5.1 I suppose): namely, would it be unusual or bad to use call a Lua
> function from a C module that was in turn about to return a result to Lua?
>
> Thanks, Peter
> --
> We have not been faced with the need to satisfy someone else's
> requirements, and for this freedom we are grateful.
>     Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
>

Not in vanilla Lua, it's not a problem; this is a perfectly legitimate use case.

In LuaJIT, it's not a good idea; crossing the C/Lua boundary like that
aborts trace compilation so you shouldn't do that in something
performance-sensitive.

/s/ Adam