summaryrefslogtreecommitdiff
path: root/val.h
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-20 23:26:18 +0100
committerubq323 <ubq323@ubq323.website>2024-06-20 23:26:18 +0100
commitf331192861d8ba02af7fd47f2e0c6d6db7515007 (patch)
tree9752cdea672d64f3ebfd3ee142185468510708fd /val.h
parentfa8891ffe017ae890f0ef07915cf8b52acd7304a (diff)
add (if cond if-true if-false) builtin
Diffstat (limited to 'val.h')
-rw-r--r--val.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/val.h b/val.h
index db0a789..aa20b48 100644
--- a/val.h
+++ b/val.h
@@ -30,6 +30,8 @@ void print_val(Val v);
void println_val(Val v);
const char *typename_str(Val v);
+bool is_truthy(Val v);
+
typedef enum {
OTY_STRING,
@@ -55,7 +57,7 @@ ObjString *objstring_copy_cstr(State *s, char *str);
ObjString *objstring_take(State *S, char *src, size_t len);
-#define IS_NIL(x) (x.ty == NIL)
+#define IS_NIL(x) (x.ty == TY_NIL)
#define IS_NUM(x) (x.ty == TY_NUM)
#define IS_BOOL(x) (x.ty == TY_BOOL)
#define IS_OBJ(x) (x.ty == TY_OBJ)