lua-users home
lua-l archive

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

on 2/25/05 1:13 PM, PA at wrote:

> I don't mind the dot. I mind having dots _and_ colons :))

They mean different things. The solutions that make the dot do the work of
the colon tend to be significantly less efficient and one of Lua's other
strengths is that it's fast.

One problem I do have is that using dots where you meant to use colons
doesn't generate errors as early in the process as one might like. For
example, if

    obj:msg( x )

is valid, then so is:

    obj.msg( x )

Both will lead to the same function getting executed but with a different
value for the first parameter. If x is a table, then the error may not be
detected particularly promptly.