lua-users home
lua-l archive

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

> -----Original Message-----
> From: [mailto:lua-
>] On Behalf Of Peter Cawley
> Sent: 31 March 2009 15:57
> To: Lua list
> Subject: Re: How do I add a "local" using the c api
> On Tue, Mar 31, 2009 at 3:49 PM, Tom Miles <Tom@creative-
>> wrote:
> > What is meant by a chunk in this case?
> A piece of input. The input data (be it binary compiled, or plain text
> source) can be split up into arbitrarily sized 'chunks'.
> > What use is the data parameter used for?
> The data argument is an opaque value passed to the reader function
> (from lua_load documentation). Commonly it'll point to some kind of
> data loading structure which you pass to lua_load.
> > What point is the state in this case for that matter, and is it
> to manipulate it?
> It is valid to manipulate, for example the standard global load()
> function uses it to call a Lua function to get the input chunks.

Okay, that makes more sense.  I guess I should have read the lua_load
section as well. my excuse is that I'm in the middle of something else
here :)

Having said that, I still fail to know how using a lua_Reader can help
me store some local variables in the state, and still think the
documentation is a little confusing/lacking.

I've just found a little bit of information in PiL about readers, but
not much.