From b8d0ee2e105727021f9466790ec07ecbfee8dff6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 17:23:01 +0100 Subject: string interning and print statement --- val.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'val.h') diff --git a/val.h b/val.h index d742c14..4c84fd9 100644 --- a/val.h +++ b/val.h @@ -71,6 +71,8 @@ ObjString *objstring_take(State *S, char *src, size_t len); #define VAL_NIL ((Val){.ty=TY_NIL}) #define VAL_NUM(x) ((Val){.ty=TY_NUM, .as.d=(x) }) #define VAL_BOOL(x) ((Val){.ty=TY_BOOL, .as.b=(x) }) +#define VAL_TRUE VAL_BOOL(1) +#define VAL_FALSE VAL_BOOL(0) #define VAL_OBJ(x) ((Val){.ty=TY_OBJ, .as.o=(Obj*)(x) }) static inline bool is_obj_ty(Val v, ObjTy t) { -- cgit v1.2.3