lua-users home
lua-l archive

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

It's quite an easy change to the parser, see:

The patch is a little different though - for my oo system I prefer to have implicit selfs inside table functions, just look for the comment inside function "funcfield" to alter this behaviour. I think really it should be in the core, given that as original poster said it's supposed to be just syntactic sugar.

Oh, the patch also makes commas optional following an inline function.

- Alex

(P.S. my emails been really unreliable, this message didn't appear on the list hours ago when I first tried, so I'm really hoping I won't flood the list when whatever's causing the problem unclogs)

On Thu Feb 21 10:56 , 'Mark Meijer' <> sent:

I've been wondering the same thing, especially as "function foo()" is
just syntactic sugar for "foo = function()". But I'm guessing it has
something to do with how the parser is built.

I do think it would be nice to allow it. Given the fact that keywords
(such as "function") are not allowed as names (i.e. string keys using
the "table.key" or "table:key" syntax), I think it shouldn't be much
of a problem for the parser.