[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Language Syntax
- From: Duncan Cross <duncan.cross@...>
- Date: Sat, 21 Jun 2014 20:34:47 +0100
On Sat, Jun 21, 2014 at 7:43 PM, Lucas <cad.lua@lucasjr.nospammail.net> wrote:
> I could not find an explanation why the result of an attribuition isnt
> the attribuition itself, just like in C, which I can write:
>
> x = y = z = 1;
>
> can anybody point me out why?
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.
-Duncan