xo-numeric: attach type to numeric primitives

This commit is contained in:
Roland Conybeare 2026-03-16 13:51:51 -05:00
commit a66cd3cf91
5 changed files with 134 additions and 37 deletions

View file

@ -48,6 +48,9 @@ namespace xo {
/** any numeric type: i16|i32|i64|f32|f64 **/
t_numeric,
/** generalized boolean type: bool, function with bool codomain **/
t_booleic,
/** any callable type (e.g. all function types) **/
t_callable,
@ -78,6 +81,7 @@ namespace xo {
static Metatype t_dict() { return Metatype(code::t_dict); }
static Metatype t_integer() { return Metatype(code::t_integer); }
static Metatype t_numeric() { return Metatype(code::t_numeric); }
static Metatype t_booleic() { return Metatype(code::t_booleic); }
static Metatype t_callable() { return Metatype(code::t_callable); }
static Metatype t_any() { return Metatype(code::t_any); }

View file

@ -31,6 +31,7 @@ namespace xo {
case code::t_dict: return "dict";
case code::t_integer: return "integer";
case code::t_booleic: return "booleic";
case code::t_numeric: return "numeric";
case code::t_callable: return "callable";
case code::t_any: return "any";
@ -76,6 +77,8 @@ namespace xo {
case code::t_integer:
return true;
case code::t_booleic:
return true;
case code::t_numeric:
return true;
case code::t_callable: