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 <> 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.

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.