From 0eb1d9b526d3add1e3645b0ed550631fa12a3526 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 28 Jan 2026 10:57:55 -0500 Subject: [PATCH] xo-reader2 xo-expression2: + DLambdaSsm [WIP] --- include/xo/expression2/DConstant.hpp | 14 +++++++++++--- include/xo/expression2/DLambdaExpr.hpp | 4 ++-- src/expression2/DLambdaExpr.cpp | 6 ++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/xo/expression2/DConstant.hpp b/include/xo/expression2/DConstant.hpp index 50f0e38f..1046176a 100644 --- a/include/xo/expression2/DConstant.hpp +++ b/include/xo/expression2/DConstant.hpp @@ -44,18 +44,26 @@ namespace xo { bool is_resolved() const noexcept { return typeref_.is_resolved(); } - exprtype extype() const noexcept { return exprtype::constant; } + obj value() const noexcept { return value_; } TypeDescr value_td() const noexcept { return typeref_.td(); } TaggedPtr value_tp() const noexcept { return TaggedPtr(typeref_.td(), value_.data()); } + /** @defgroup scm-constant-expression-facet **/ + ///@{ + + exprtype extype() const noexcept { return exprtype::constant; } TypeRef typeref() const noexcept { return typeref_; } TypeDescr valuetype() const noexcept { return typeref_.td(); } - obj value() const noexcept { return value_; } - void assign_valuetype(TypeDescr td) noexcept { typeref_.resolve(td); } + ///@} + /** @defgroup scm-constant-printable-facet **/ + ///@{ + bool pretty(const ppindentinfo & ppii) const; + ///@} + private: static TypeDescr _lookup_td(typeseq tseq); diff --git a/include/xo/expression2/DLambdaExpr.hpp b/include/xo/expression2/DLambdaExpr.hpp index 72492ffb..bd9ff2c5 100644 --- a/include/xo/expression2/DLambdaExpr.hpp +++ b/include/xo/expression2/DLambdaExpr.hpp @@ -34,14 +34,12 @@ namespace xo { DLocalSymtab * local_symtab, obj body); -#ifdef NOT_YET /** create instance using memory from @p mm **/ static obj make(obj mm, TypeRef typeref, const DUniqueString * name, DLocalSymtab * local_symtab, obj body); -#endif /** create instance, using memory from @p mm **/ static DLambdaExpr * _make(obj mm, @@ -53,6 +51,8 @@ namespace xo { /** @defgroup scm-lambdaexpr-methods **/ ///@{ + DLocalSymtab * local_symtab() const noexcept { return local_symtab_; } + // get_free_variables() // visit_preorder() // visit_layer() diff --git a/src/expression2/DLambdaExpr.cpp b/src/expression2/DLambdaExpr.cpp index 18f737ab..fec939ac 100644 --- a/src/expression2/DLambdaExpr.cpp +++ b/src/expression2/DLambdaExpr.cpp @@ -4,7 +4,7 @@ **/ #include "DLambdaExpr.hpp" -// #include "detail/IExpression_DLambdaExpr.hpp" +#include "detail/IExpression_DLambdaExpr.hpp" #include #include #include @@ -53,7 +53,6 @@ namespace xo { { } -#ifdef NOT_YET obj DLambdaExpr::make(obj mm, TypeRef typeref, @@ -62,9 +61,8 @@ namespace xo { obj body) { return obj(_make(mm, typeref, - name, local_symtab, body); + name, local_symtab, body)); } -#endif DLambdaExpr * DLambdaExpr::_make(obj mm,