lua-users home
lua-l archive

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


On Sat, Nov 27, 2010 at 02:15, Mark Hamburg <mark@grubmah.com> wrote:
> On Nov 26, 2010, at 12:17 PM, Pierre-Yves Gérardy wrote:
>
>> ^[ x,y | statements => explist ]
>
> Anything that allows a statement list seems like a slippery slope to abandoning function() ... end

That's true. On the other hand, as I said elsewhere, most cases where
the current syntax is IMO good (top level assignments) are covered by
the "function foo () ... end" statement. The exception is
"tbl[not_a_string] = function () end".

Inline functions clash with the rest of the expressions.

You can easily tell digits, strings, variables and table literals
apart. the `function `return `end, are words, and, at a glance, look
like variables. Even with syntax colouring, it's often heavy and
distracting.

Imagine a world where this table constructor

    t = { 5, 2; foo="bar",baz="qux" }

would be

    t = table array 5, 2 hash "foo", "bar", "baz", "qux" end -- :-/

Ok, that was a strawman, it's not that bad with functions.


> ... which is probably politically untenable.
Conservatism is a tough beast to fight.

> On the other hand, since Lua is more statement-oriented than expression-oriented, anything that is restricted to expressions will create other pressures.

Indeed...