From 058d954e80f83c26deb209008f11d87a5b59418e Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Thu, 30 Dec 2021 16:02:10 +0100 Subject: Unify value types --- std/bool.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'std/bool.c') diff --git a/std/bool.c b/std/bool.c index 76772bf..02aa887 100644 --- a/std/bool.c +++ b/std/bool.c @@ -87,10 +87,9 @@ UwUVMValue uwu_is(UwUVMArgs *args) if (args->num < 1) error("error: :bool:is requires at least 1 argument\n"); - for (size_t i = 0; i < args->num; i++) { - UwUVMValue value = uwuvm_get_arg(args, i); - return uwubool_create(value.type != VT_NAT || value.value.nat_value.type != &uwubool_type); - } + for (size_t i = 0; i < args->num; i++) + if (uwuvm_get_arg(args, i).type != &uwubool_type) + return uwubool_create(false); return uwubool_create(true); } -- cgit v1.2.3