xo-interpreter2 stack: work on apply for closures [WIP]

This commit is contained in:
Roland Conybeare 2026-02-12 20:09:22 -05:00
commit 5b97cddbcd
10 changed files with 79 additions and 31 deletions

View file

@ -3,7 +3,7 @@
* @author Roland Conybeare, Feb 2026
**/
#include "DRuntimeError.hpp"
#include "RuntimeError.hpp"
namespace xo {
using xo::mm::AGCObject;
@ -11,6 +11,24 @@ namespace xo {
namespace scm {
obj<AGCObject,DRuntimeError>
DRuntimeError::make(obj<AAllocator> mm,
const char * src_fn,
const char * error_descr)
{
DRuntimeError * err = DRuntimeError::_make(mm, nullptr, nullptr);
// pedantic: allocate strings after allocating DRuntimeError instance
DString * src = DString::from_cstr(mm, src_fn);
DString * err_descr = DString::from_cstr(mm, error_descr);
err->src_function_ = src;
err->error_descr_ = err_descr;
return obj<AGCObject,DRuntimeError>(err);
}
DRuntimeError *
DRuntimeError::_make(obj<AAllocator> mm,
DString * src_fn,