lua-users home
lua-l archive

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


2013/9/7 Musical Notation <musicdenotation@gmail.com>:
> 1. Can code blocks have values?

No.

> 2. Is the if construct an expression and can return a value?

No.

Have a look at the language syntax in the manual:
http://www.lua.org/manual/5.2/manual.html#9

In Lua statements ('stat' in the syntax) are not expressions ('exp' in
the syntax), and expressions are not statements, even if some code
constructs (like 'functioncall') can be both.