xo-procedure2: + type_ member [WIP]

This commit is contained in:
Roland Conybeare 2026-03-12 20:43:14 -05:00
commit 337835409a
3 changed files with 14 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#pragma once
#include "RuntimeContext.hpp"
#include <xo/type/Type.hpp>
#include <xo/object2/DArray.hpp>
#include <xo/alloc2/GCObjectConversion.hpp>
#include <xo/alloc2/GCObject.hpp>
@ -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<AType> type_;
/** type description for implementation function
* Note that this type description will have additional first argument
* for obj<ARuntimeContext>
**/

View file

@ -40,6 +40,9 @@ namespace xo {
/* struct<a:T,b:U,..> */
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 **/

View file

@ -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;
}