lua-users home
lua-l archive

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


On Wed, Aug 26, 2015 at 8:59 PM, Nan Xiao <xiaonan830818@gmail.com> wrote:
> Hi Coda,
>
>> a chunk containing a single statement that contains a function call
>> expression.
>
> Sorry, I am a little confused. If possible, could you spare a little time to
> explain the
> relationship among chunk, statement and expression?

Does the Lua grammar help?

"stat" is a statement.  "exp" is an expression.

http://www.lua.org/manual/5.3/manual.html#9

Note: There is some overlap.  Some statements also happen to be
expressions (and vice versa).

For example:  "x" is an expression (it expresses a value).  "x = 5" is
a statement.  "foo ()" is both.

The load function turns a chunk into a function.

http://www.lua.org/manual/5.3/manual.html#pdf-load

-Parke