xo-interpreter2 stack: modularize nth() primitive setup/install
This commit is contained in:
parent
f6ecc56a1c
commit
6d6066995a
7 changed files with 158 additions and 2 deletions
|
|
@ -72,6 +72,7 @@ namespace xo {
|
|||
template <typename Fn>
|
||||
class Primitive {
|
||||
public:
|
||||
using FunctionPtrType = Fn;
|
||||
using Traits = detail::PmFnTraits<Fn>;
|
||||
|
||||
using ACollector = xo::mm::ACollector;
|
||||
|
|
|
|||
29
include/xo/procedure2/ObjectPrimitives.hpp
Normal file
29
include/xo/procedure2/ObjectPrimitives.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/** @file ObjectPrimitives.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Mar 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/procedure2/DPrimitive_gco_2_gco_gco.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @brief primitives centered on object2/ data structures.
|
||||
*
|
||||
* Note: they don't reside in object2/ because DPrimitive
|
||||
* not available yet at that level
|
||||
**/
|
||||
class ObjectPrimitives {
|
||||
public:
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
||||
public:
|
||||
/** create primitive for fetching nth element of a sequence **/
|
||||
static DPrimitive_gco_2_gco_gco * make_nth_pm(obj<AAllocator> mm);
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ObjectPrimitives.hpp */
|
||||
|
|
@ -10,8 +10,10 @@
|
|||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** Register gc-aware (AGCObject,DRepr) combinations with garbage collector @p gc **/
|
||||
bool procedure2_register_primitives(obj<xo::mm::AAllocator> gc, InstallSink sink);
|
||||
/** Register primitive-factories **/
|
||||
bool procedure2_register_primitives(obj<xo::mm::AAllocator> gc,
|
||||
InstallSink sink,
|
||||
InstallFlags flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue