lua-users home
lua-l archive

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

2012/6/5 Emeka <>:

> What is "CHUNK"?

The Lua interpreter works like this:

1. You type in something and hit return.
2. If it is obviously unfinished (e.g. a closing `)`, `}`, `]`, `end`
has not yet been supplied) the interpreter goes back to Step 1;
what you type in now gets appended to what you typed in before.
3. If it is not obviously unfinished, everything you typed in makes
one chunk.  Lua will now try to compile it and execute it.

If you "dofile" something, the whole file is treated as one chunk.