This commit is contained in:
Lobo 2026-01-21 13:48:20 -03:00
parent 6a9a0cd4e4
commit d359c68c32
16 changed files with 2026 additions and 89 deletions

View file

@ -2,6 +2,7 @@
#include <stdio.h>
#include "object.h"
#include "string.h"
#include "print.h"
V print(O o) {
@ -10,10 +11,16 @@ V print(O o) {
} else if (IMM(o)) {
printf("%" PRIdPTR, ORD(o));
} else {
switch (type(o)) {
case TYPE_QUOT:
Hd *hdr = UNBOX(o);
switch (hdr->type) {
case OBJ_QUOT:
printf("<quotation>");
break;
case OBJ_STR: {
Str *s = string_unwrap(o);
printf("\"%.*s\"", (int)s->len, s->data);
break;
}
default:
printf("<obj type=%ld ptr=%p>", type(o), (void *)o);
}