+struct ao_lisp_bool {
+ uint8_t type;
+ uint8_t value;
+ uint16_t pad;
+};
+
+struct ao_lisp_bigint {
+ uint32_t value;
+};
+
+struct ao_lisp_float {
+ uint8_t type;
+ uint8_t pad1;
+ uint16_t pad2;
+ float value;
+};
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+static inline uint32_t
+ao_lisp_int_bigint(int32_t i) {
+ return AO_LISP_BIGINT | (i << 8);
+}
+static inline int32_t
+ao_lisp_bigint_int(uint32_t bi) {
+ return (int32_t) bi >> 8;
+}
+#else
+static inline uint32_t
+ao_lisp_int_bigint(int32_t i) {
+ return (uint32_t) (i & 0xffffff) | (AO_LISP_BIGINT << 24);
+}
+static inlint int32_t
+ao_lisp_bigint_int(uint32_t bi) {
+ return (int32_t) (bi << 8) >> 8;
+}
+#endif
+
+#define AO_LISP_MIN_INT (-(1 << (15 - AO_LISP_TYPE_SHIFT)))
+#define AO_LISP_MAX_INT ((1 << (15 - AO_LISP_TYPE_SHIFT)) - 1)
+#define AO_LISP_MIN_BIGINT (-(1 << 24))
+#define AO_LISP_MAX_BIGINT ((1 << 24) - 1)
+
+#define AO_LISP_NOT_INTEGER 0x7fffffff
+
+/* Set on type when the frame escapes the lambda */
+#define AO_LISP_FRAME_MARK 0x80
+#define AO_LISP_FRAME_PRINT 0x40
+
+static inline int ao_lisp_frame_marked(struct ao_lisp_frame *f) {
+ return f->type & AO_LISP_FRAME_MARK;
+}
+