lua-users home
lua-l archive

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


> One problem is that the logical operators 'and' and 'or' use short-circuit
> evaluation, which is not easy to implement efficiently for user defined
> objects.

Exaclty. In Lua, as in many other languages, 'and' and 'or' are not
exactly operators; they are more like control structures. They do not
generate a single opcode, but a sequence of tests and jumps.

In statically typed languages, the compiler knows in advance what to
do. For a dynamic language, once the control code is generated, it is
hard to change it.

-- Roberto