diff --git a/xo-procedure2/include/xo/procedure2/DPrimitive.hpp b/xo-procedure2/include/xo/procedure2/DPrimitive.hpp index 7735bf0b..4cc45f83 100644 --- a/xo-procedure2/include/xo/procedure2/DPrimitive.hpp +++ b/xo-procedure2/include/xo/procedure2/DPrimitive.hpp @@ -6,6 +6,7 @@ #pragma once #include "RuntimeContext.hpp" +#include #include #include #include @@ -152,7 +153,12 @@ namespace xo { /** name of this primitive **/ std::string_view name_; - /** type description for function + /** primitive type-constructor. These are non-trivial to establish; + * not convenient to establish in ctor + **/ + obj type_; + + /** type description for implementation function * Note that this type description will have additional first argument * for obj **/ diff --git a/xo-type/include/xo/type/Metatype.hpp b/xo-type/include/xo/type/Metatype.hpp index 6fc193ae..30952df8 100644 --- a/xo-type/include/xo/type/Metatype.hpp +++ b/xo-type/include/xo/type/Metatype.hpp @@ -40,6 +40,9 @@ namespace xo { /* struct */ t_struct, + /* any numeric type: i16|i32|i64|f32|f64 */ + t_numeric, + /* any type at all */ t_any, }; @@ -64,6 +67,7 @@ namespace xo { static Metatype t_function() { return Metatype(code::t_function); } static Metatype t_struct() { return Metatype(code::t_struct); } + static Metatype t_numeric() { return Metatype(code::t_numeric); } static Metatype t_any() { return Metatype(code::t_any); } /** description string for this type category **/ diff --git a/xo-type/src/type/Metatype.cpp b/xo-type/src/type/Metatype.cpp index ca61d9c9..9e50f11a 100644 --- a/xo-type/src/type/Metatype.cpp +++ b/xo-type/src/type/Metatype.cpp @@ -29,6 +29,7 @@ namespace xo { case code::t_function: return "function"; case code::t_struct: return "struct"; + case code::t_numeric: return "numeric"; case code::t_any: return "any"; } } @@ -68,6 +69,8 @@ namespace xo { case code::t_struct: return false; + case code::t_numeric: + return true; case code::t_any: return true; }