typedef struct
{
- alignas (8) uint32_t _pad;
+ alignas (8)
+ // layout so that value can be upcast by reinterpreting as a fix64
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ int32_t n;
+ uint32_t _pad;
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ uint32_t _pad;
int32_t n;
+#else
+#error Unusual endianness?
+#endif
} fix32_val;
typedef struct
{
vector_object vector;
uvector_object uvector;
atom_object atom;
+ subr_object subr;
} pool_object;
union object
uvector_object uvector;
atom_object atom;
tuple_object tuple;
+ subr_object subr;
};
/**
uint32_t list_length (const list_object * o);
+dope_object *vec_dope (const vector_object * o);
+
dope_object *uv_dope (const uvector_object * o);
static inline evaltype
o->type = type;
}
+// Allocate an vector of LOSEs and return a handle with length=0.
+vector_object vector_create (uint32_t capacity);
+
+// Stack-like interface to a VECTOR (with automatic GROW!)
+object *stack_push (vector_object * v);
+
/**
Checked downcasts.
*/
+static inline fix32_object *
+as_fix32 (object * o)
+{
+ assert (TYPEPRIM_EQ (o->type, TYPEPRIM_FIX32));
+ return &o->fix32;
+}
+
static inline list_object *
as_list (object * o)
{