xo-interpreter2 stack: modularize nth() primitive setup/install
This commit is contained in:
parent
c500a98722
commit
692a9a7f1b
4 changed files with 34 additions and 8 deletions
|
|
@ -35,6 +35,10 @@ namespace xo {
|
|||
static DPrimitive_gco_2_gco_gco * make_cmplt_pm(obj<AAllocator> mm);
|
||||
/** polymorphic (in both arguments) compare (<=) **/
|
||||
static DPrimitive_gco_2_gco_gco * make_cmple_pm(obj<AAllocator> mm);
|
||||
/** polymorphic (in both arguments) compare (>) **/
|
||||
static DPrimitive_gco_2_gco_gco * make_cmpgt_pm(obj<AAllocator> mm);
|
||||
/** polymorphic (in both arguments) compare (>=) **/
|
||||
static DPrimitive_gco_2_gco_gco * make_cmpge_pm(obj<AAllocator> mm);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** Register gc-aware (AGCObject,DRepr) combinations with garbage collector @p gc **/
|
||||
bool numeric_register_primitives(obj<xo::mm::AAllocator> gc,
|
||||
/** Register primitive factories with primitive registry **/
|
||||
bool numeric_register_primitives(obj<xo::mm::AAllocator> mm,
|
||||
InstallSink sink,
|
||||
InstallFlags flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,22 @@ namespace xo {
|
|||
&NumericDispatch::cmp_lessequal);
|
||||
}
|
||||
|
||||
DPrimitive_gco_2_gco_gco *
|
||||
NumericPrimitives::make_cmpgt_pm(obj<AAllocator> mm)
|
||||
{
|
||||
return DPrimitive_gco_2_gco_gco::_make(mm, "_cmpgt",
|
||||
&NumericDispatch::cmp_greater);
|
||||
}
|
||||
|
||||
DPrimitive_gco_2_gco_gco *
|
||||
NumericPrimitives::make_cmpge_pm(obj<AAllocator> mm)
|
||||
{
|
||||
return DPrimitive_gco_2_gco_gco::_make(mm, "_cmpge",
|
||||
&NumericDispatch::cmp_greatequal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
|
|
@ -61,18 +61,24 @@ namespace xo {
|
|||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_divide_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_add", &NumericDispatch::add,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_add_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_sub", &NumericDispatch::subtract,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_subtract_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
|
||||
ok = ok & install_aux(sink, mm, "_cmpeq", &NumericDispatch::cmp_equal,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_cmpeq_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmpne", &NumericDispatch::cmp_notequal,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_cmpne_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmplt", &NumericDispatch::cmp_less,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_cmplt_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmple", &NumericDispatch::cmp_lessequal,
|
||||
ok = ok & install_aux(sink,
|
||||
NumericPrimitives::make_cmple_pm(mm),
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmpgt", &NumericDispatch::cmp_greater,
|
||||
flags & InstallFlags::f_essential);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue