lua-users home
lua-l archive

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


2014/1/2 Sir Pogsalot <sir.pogsalot@gmail.com>:
> On Fri, Dec 27, 2013 at 12:46 PM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
>>
>> The manual says that access to metatables are raw:
>>
>>         metatable(obj)[event]
>>         should be read as
>>         rawget(getmetatable(obj) or {}, event)
>>
>> http://www.lua.org/manual/5.2/manual.html#2.4
>>
>
> I very much so disagree with this, because of how tedious it makes proxy
> tables to implement.

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.

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.

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.