1
0
Fork 0

type predicates

This commit is contained in:
Alex Kotov 2023-05-04 15:43:14 +04:00
parent 0b10256cbb
commit 461da821f1
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 102 additions and 13 deletions

View file

@ -81,6 +81,12 @@ void Object_print(struct Object *const self, const unsigned indent)
Object_print(self->pair.a, indent + 1);
Object_print(self->pair.b, indent + 1);
break;
case TYPE_BOOLEAN:
printf("%s\n", self->boolean ? "#t" : "#f");
break;
case TYPE_CHAR:
printf("%c\n", self->chr);
break;
case TYPE_SYMBOL:
case TYPE_STRING:
printf("%s\n", self->s);
@ -88,7 +94,5 @@ void Object_print(struct Object *const self, const unsigned indent)
case TYPE_NUMBER:
printf("%li\n", self->i);
break;
default:
break;
}
}