lua-users home
lua-l archive

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



> I believe C++ must also decide at runtime.

C++ can tell at compile time because the short-circuit behaviour
only applies to primitive types, not classes. (You cannot subclass
a primitive type in C++).

In my opinion, the fact that you can override short-circuiting
operators in C++ is just plain wierd. But the fact that you
can override , is pretty wierd too. C++ gives you lots of
latitude to write unreadable programs.

In any event, the use of "+" for "or" and "*" for "and" makes
a lot of sense; few datatypes would require different semantics.

Rici.