On 21/06/14 20:34, Duncan Cross wrote:
[...]
My understanding is that the blurred distinction between statement and
expression that you find in C adds a level of complexity to the parser
that (the Lua team have decided) is not justified. As a language that
is usually parsed at run-time, Lua's syntax is designed, from the
bottom up, to be parsed/compiled quickly. A strict separation between
statement and expression is a part of this.
I've tried to implement this sort of thing myself. It's a pig, with
rough edges everywhere. Consider:
a, b, c = function_returning_multiple()
vs.
function_with_arguments(a, b, c = function_returning_multiple())