xo-numeric: attach type to numeric primitives
This commit is contained in:
parent
67228c0dc9
commit
c8d08133ae
2 changed files with 7 additions and 0 deletions
|
|
@ -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); }
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue