diff options
Diffstat (limited to 'val.c')
-rw-r--r-- | val.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -75,6 +75,12 @@ void println_val(Val v) { putchar('\n'); } +bool is_truthy(Val v) { + if (IS_NIL(v) || ( IS_BOOL(v) && AS_BOOL(v) == false)) + return false; + return true; +} + const char *typename_str(Val v) { switch(v.ty) { |