[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Best practices for lua_Reader?
- From: Oliver Schneider <lua-mailinglist@...>
- Date: Sat, 09 Jun 2012 23:52:16 +0000
On 2012-06-09 23:40, Peter Cawley wrote:
> The auxiliary library function luaL_loadbuffer covers exactly this
> use-case. Either call it directly, or consult the Lua source code to
> see how it implements a reader.
Thanks, Peter.
I should have been a bit more precise about my use case. I'm trying to
use the reader for the preload mechanism in Lua, not just execute a
chunk for a call. I see lua_load() (called by luaL_loadbuffer as well)
in the call stack, so I guess I'll dig a bit into the code to see how
this can be leveraged for 'require' and 'dofile'.
The implemented reader (getS) gives me a good idea already.
Thanks again,
// Oliver