xo-interpreter2 stack: work on VSM for apply -> closure action [WIP]

This commit is contained in:
Roland Conybeare 2026-02-08 01:01:03 -05:00
commit 82c82ea332
21 changed files with 508 additions and 14 deletions

View file

@ -3,7 +3,10 @@
* @author Roland Conybeare, Feb 2026
**/
#include "DClosure.hpp"
#include "Closure.hpp"
#include "LambdaExpr.hpp"
#include "LocalEnv.hpp"
#include <cstddef>
namespace xo {
using xo::mm::AGCObject;
@ -35,6 +38,37 @@ namespace xo {
assert(false);
}
size_t
DClosure::shallow_size() const noexcept {
return sizeof(DClosure);
}
DClosure *
DClosure::shallow_copy(obj<AAllocator> mm) const noexcept {
DClosure * copy = (DClosure *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
std::size_t
DClosure::forward_children(obj<ACollector> gc) noexcept
{
{
auto iface = xo::facet::impl_for<AGCObject,DLambdaExpr>();
gc.forward_inplace(&iface, (void **)(&lambda_));
}
{
auto iface = xo::facet::impl_for<AGCObject,DLocalEnv>();
gc.forward_inplace(&iface, (void **)(&env_));
}
return shallow_size();
}
} /*namespace scm*/
} /*namespace xo*/