[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Random thought: type(v) -> type, subtype, ... ?
- From: Kim Alvefur <zash@...>
- Date: Fri, 27 Jan 2017 14:22:03 +0100
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