lua-users home
lua-l archive

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


On Fri, Jan 3, 2014 at 5:44 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
LHF's comment is not an opinion, it is a fact. It quotes official documentation
in order to explain why something works the way that it does. One cannot
disagree with a fact.

I understand this, I was saying I disagree with the current implementation.  This posting is very related to another I posted a week ago about making __call recursive.

It means that to change this behaviour (without going into the details
of whether the change is desirable) would strike at the heart of Lua,
possibly causing thousands of programs that rely on documented
behaviour to fail.

I do not worry about this because Lua is oriented toward embedding.  If a drastic change like this were made for a later major version (5.3?), I imagine some would opt for 5.2 -- much like how people still opt for 5.1 for some things.
 
There are quite a few things that are tedious in Lua (absence of
lambda notation for anonymous functions being another perennial
favourite). Tedious is not a synonym for obscure. On the contrary,
tedious code is extremely clear; one can write it without thinking.

If you do not like tedious code in your programs, hide it in a module.
That's what modules are for.

1) (function () print 'this doesn't feel tedious to me..' end)()

2) Tediousness is (by definition) frustrating. does not save time -- I'm sure we disagree on where exactly the line between concision and clarity should lie. :-)  My issue is that I know metatables are just tables themselves, and I expect that I can modify their behavior by setting a metatable on a metatable.  I would not know this is intentionally disallowed unless I read the Lua manual.  To me it feels like it's violating a core behavior to not allow metatables to act as 'full-blown' tables.  At worst, allowing non-raw access on metatables might cause a stack overflow if it recursed enough.  Propagating `self' might be confusing, also.

3) In my experience and talking with regulars in #lua on Freenode, I've seen many people avoid third-party modules that are expansively written.  I agree that while tedious code can read clearer, it can still make a third-party module hard to review depending on the bulk load of what was written.  In my example I feel like the meaning was less clear, but it was more efficient because I avoided functions that would essentially chain through to