Add an 'undefined' value and a function to convert booleans into values.
This commit is contained in:
parent
0005ef2f86
commit
56a67a263d
6
gc.h
6
gc.h
|
|
@ -32,6 +32,7 @@ typedef intptr_t fixnum_t;
|
|||
#define BROKEN_HEART SPECIAL_VALUE(0)
|
||||
#define FALSE_VALUE SPECIAL_VALUE(1)
|
||||
#define TRUE_VALUE SPECIAL_VALUE(2)
|
||||
#define UNDEFINED SPECIAL_VALUE(3)
|
||||
|
||||
#define TYPE_TAG_BOX TYPE_TAG(0)
|
||||
#define TYPE_TAG_VECTOR TYPE_TAG(1)
|
||||
|
|
@ -180,6 +181,11 @@ static inline bool is_boolean(value_t v)
|
|||
return (v == FALSE_VALUE) || (v == TRUE_VALUE);
|
||||
}
|
||||
|
||||
static inline value_t make_boolean(bool b)
|
||||
{
|
||||
return b ? TRUE_VALUE : FALSE_VALUE;
|
||||
}
|
||||
|
||||
static inline value_t object_value(void *obj)
|
||||
{
|
||||
assert((uintptr_t)obj >= 4096);
|
||||
|
|
|
|||
Loading…
Reference in New Issue