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,8 @@
* @author Roland Conybeare, Feb 2026
**/
#include "DLocalEnv.hpp"
#include "LocalEnv.hpp"
#include <xo/object2/Array.hpp>
#include <xo/reflectutil/typeseq.hpp>
namespace xo {
@ -86,6 +87,40 @@ namespace xo {
/* something terribly wrong if control here */
}
std::size_t
DLocalEnv::shallow_size() const noexcept {
return sizeof(DLocalEnv);
}
DLocalEnv *
DLocalEnv::shallow_copy(obj<AAllocator> mm) const noexcept {
DLocalEnv * copy = (DLocalEnv *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
std::size_t
DLocalEnv::forward_children(obj<ACollector> gc) noexcept
{
{
auto iface = xo::facet::impl_for<AGCObject,DLocalEnv>();
gc.forward_inplace(&iface, (void **)(&parent_));
}
{
auto iface = xo::facet::impl_for<AGCObject,DLocalSymtab>();
gc.forward_inplace(&iface, (void **)(&symtab_));
}
{
auto iface = xo::facet::impl_for<AGCObject,DArray>();
gc.forward_inplace(&iface, (void **)(&args_));
}
return shallow_size();
}
} /*namespace scm*/
} /*namespace xo*/