lua-users home
lua-l archive

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


> selectF(x, function() return tableA.foo end, function() return
> tableB.foo end, function() return tableC.foo end)
> 
> wouldn't these be more readable?  Say,
> 
> selectF(x, (<=tableA.foo), (<=tableB.foo), (<=tableC.foo))
> 
> or
> 
> selectF(x, \(tableA.foo), \(tableB.foo), \(tableC.foo))

actually they are all not very readable, but at least in the first version I can readily tell what the code does. ALL of the syntax proposals for lightweight function syntax have one  thing in common: they do look like perl (or APL or other line noise languages). Don't get me wrong, I like perl a lot, and I use it a lot, but I would not want lua to look like perl. This sort of thing works in perl, because its entire syntax is a convoluted and probably nondeterministic mess, but lua syntax is rather clean, eloquent and very readable, so having line noise in there creates a WTF moment... at least for me.

I would consider this entire matter to be a case for something like metalua, not for the core syntax.

Gunnar