diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-20 23:26:18 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-20 23:26:18 +0100 |
commit | f331192861d8ba02af7fd47f2e0c6d6db7515007 (patch) | |
tree | 9752cdea672d64f3ebfd3ee142185468510708fd /val.h | |
parent | fa8891ffe017ae890f0ef07915cf8b52acd7304a (diff) |
add (if cond if-true if-false) builtin
Diffstat (limited to 'val.h')
-rw-r--r-- | val.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |