lua-users home
lua-l archive

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


On Mon, 07 Dec 2009 16:20:16 +0200, David Kastrup <dak@gnu.org> wrote:

"Juris Kalnins" <juris@mt.lv> writes:

There was a nice proposal in another message,
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
And one possible syntax could be
	function (x,y,z)=x+y*z

function (x,y,z = x+y*z), which doesn't have issues with finding
expression end would be even nicer.

And both are an entire token shorter than what we have now.  And the
latter looks only a little bit like initialized function arguments.

And the former only a little bit like an assignment.

And I look only a little bit exasperated.


Please don't. In this thread, you reasoned very well why it is
not beneficial to complicate syntax of Lua, as a language.

However, as it could be inferred from the tail of my message, or from
the fact that the thread spawned from the GSL shell post, such
changes might be very useful, when Lua is used as a codebase for
performing specific task in an application.

And since Lua C code is so well written, it is often tempting to
use it for things other than running Lua, e.g. config file parsing.
Usually, it is much easier to modify Lua to support needed extension
than it is to make a rewrite engine.

That's why it is very useful to know how to make these modifications,
even though having them in main Lua code would benefit no one.