added boolean fns to vm
parent
0f2a89cfbd
commit
25d0bb756f
|
@ -3,14 +3,24 @@
|
||||||
namespace factor
|
namespace factor
|
||||||
{
|
{
|
||||||
|
|
||||||
VM_C_API void box_boolean(bool value)
|
void factorvm::box_boolean(bool value)
|
||||||
{
|
{
|
||||||
dpush(value ? T : F);
|
dpush(value ? T : F);
|
||||||
}
|
}
|
||||||
|
|
||||||
VM_C_API bool to_boolean(cell value)
|
VM_C_API void box_boolean(bool value)
|
||||||
|
{
|
||||||
|
return vm->box_boolean(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool factorvm::to_boolean(cell value)
|
||||||
{
|
{
|
||||||
return value != F;
|
return value != F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VM_C_API bool to_boolean(cell value)
|
||||||
|
{
|
||||||
|
return vm->to_boolean(value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,6 +221,10 @@ struct factorvm {
|
||||||
inline void vmprim_string_nth();
|
inline void vmprim_string_nth();
|
||||||
inline void vmprim_set_string_nth_fast();
|
inline void vmprim_set_string_nth_fast();
|
||||||
inline void vmprim_set_string_nth_slow();
|
inline void vmprim_set_string_nth_slow();
|
||||||
|
|
||||||
|
//booleans
|
||||||
|
void box_boolean(bool value);
|
||||||
|
bool to_boolean(cell value);
|
||||||
// next method here:
|
// next method here:
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue