From e02bfc916743a0327d76144b32b6ec6381e5907f Mon Sep 17 00:00:00 2001 From: eunhhu Date: Wed, 30 Sep 2026 15:51:32 +0100 Subject: Let a value's 8 bytes hold a number or an integer Before i64 (016 stage 2): a state's value, a record field's default, a list cell's number, the interpreter's stack slot and an instruction's constant become unions of a double and an int64_t (PureValue, anonymous unions in PureCell, Slot and PureOp). LOAD and STORE, and a list cell made from the stack, copy the bits; everything else reads .num as before. No behaviour changes: every check passes as it did. --- cli/pure-run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/pure-run.c') diff --git a/cli/pure-run.c b/cli/pure-run.c index 4b2e236..b9eb222 100644 --- a/cli/pure-run.c +++ b/cli/pure-run.c @@ -98,8 +98,8 @@ static void show(PureApp *app, const char *failure) { pure_draft_read(app->texts[i], 0, pure_draft_size(app->texts[i]), json_span, NULL); putchar('"'); } else if (m->state_type[i] == PURE_STATE_LIST) show_list(m, app->lists[i], &m->record[m->state_ref[i]]); - else if (m->state_type[i] == PURE_STATE_BOOL) printf("%s", app->values[i] ? "true" : "false"); - else printf("%.17g", app->values[i]); + else if (m->state_type[i] == PURE_STATE_BOOL) printf("%s", app->values[i].num ? "true" : "false"); + else printf("%.17g", app->values[i].num); } printf("},\"views\":{"); bool first = true; -- cgit v1.2.3