xo-interpreter: handle litersl strings. Broken memory model.

This commit is contained in:
Roland Conybeare 2025-11-29 20:19:33 -05:00
commit cf846b2f8d
16 changed files with 234 additions and 32 deletions

View file

@ -14,19 +14,6 @@ namespace xo {
public:
using ObjectConverter = xo::obj::ObjectConverter;
/** install conversions for PrimitiveExpr<Fn> -> Primitive<Fn>
* for particular function pointer types Fn.
*
* Source type from xo-expression
* Dest type from xo-object.
*
* Module dependence goes the other way
* i.e. xo-interpreter -uses-> xo-expression
* -uses-> xo-object
* For this reason rejected adding a virtual method to PrimitiveExprInterface
**/
static void install_interpreter_conversions(ObjectConverter * target);
template <typename Expr>
static void install_pm(gc::IAlloc * mm, rp<Expr> pm_expr, gp<GlobalEnv> env) {
gp<Object> rhs

View file

@ -23,12 +23,6 @@ namespace xo {
return x + y;
}
void
BuiltinPrimitives::install_interpreter_conversions(ObjectConverter * /*target*/)
{
/* abandoning this path */
}
void
BuiltinPrimitives::install(gc::IAlloc * mm, gp<GlobalEnv> env)
{

View file

@ -110,7 +110,6 @@ namespace xo {
toplevel_env_{env},
log_level_{ll}
{
BuiltinPrimitives::install_interpreter_conversions(&object_converter_);
}
// ----- VirtualSchematikaMachine -----
@ -321,7 +320,15 @@ namespace xo {
VSM_CONTINUE();
} else {
/* see ObjectConverter::ctor to add more builtin types */
/* see ObjectConverter::ctor to add more builtin types
*
* generally conversion for a type Foo will appear in Foo.hpp
* see
* xo/object/Boolean.hpp
* xo/object/Integer.hpp
* xo/object/Float.hpp
* xo/object/String.hpp
*/
VSM_ERROR(tostr("constant_op: unable to convert native value to object",
xtag("id", expr->value_tp().td()->id()),