lua-users home
lua-l archive

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


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

Attachment: signature.asc
Description: PGP signature