[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Language Syntax
- From: David Given <dg@...>
- Date: Sat, 21 Jun 2014 23:33:06 +0100
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())
Making assignments expressions simplifies things no end.
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "There does not now, nor will there ever, exist a programming
│ language in which it is the least bit hard to write bad programs." ---
│ Flon's Axiom
Attachment:
signature.asc
Description: OpenPGP digital signature