lua-users home
lua-l archive

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



2017-01-27 21:22 GMT+08:00 Kim Alvefur <zash@zash.se>:
Just a thought.

On Thu, Jan 26, 2017 at 10:17:39PM -0800, Tim Hill wrote:
> As I’ve pointed out before, type() needs to respect an __type() metamethod.

What if type() would return multiple values? Consider numbers in 5.3,
they have the sub-types of float and integer. So for example:

    type(1.0) -> "number", "float"

type(x) -> rawtype(x), callmeta(x, "__type")

More thoughts?

--
Regards,
Zash