lua-users home
lua-l archive

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

Xavier Wang <> writes:
> but, what is number and string?

Think of it this way:

Number and string are separate types in Lua, but in certain contexts
(e.g. arithmetic) it will automatically convert the operands from one
type to the other as required.

> maybe we can make all number-like string table index all number, is that
> more consistency?

My impression is that the generally preferred solution would be to just
remove all automatic conversions.

I don't think anybody actually thinks the automatic conversion is a
good idea these days, but it's there for historical reasons.


A zen-buddhist walked into a pizza shop and
said, "Make me one with everything."