From b8e3faaf1a3766591d31e6c5411c9e4fcc59a7a4 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Wed, 30 Sep 2026 15:23:30 +0100 Subject: Give aup a bool: true and false, and conditions that take one A condition was any number, non-zero being true: done was a number field, a view showed 1 for true, and done + 1 was no type error. Now bool is its own type (Pure 016, module format v6): - true and false; comparisons, text comparisons, has and ! && || give a bool. Bools are equal or not; they are no numbers and have no order. - if, conditional expressions, require, where (folds, walks, filtered tables) take a bool. Given a number, the diagnostic says how to make one: "if takes a bool, not a number: compare it, as in n != 0". - Bool states (state on = false), record fields (done = false), message, output and argument fields (ok: bool), lets, views and columns. Interpolation writes true or false. A list is not keyed by a bool. - The examples' flags are bools (charge's holding, toggle's visible, tasks' done). Checks: 20 bool diagnostics, a form using bools everywhere, an app whose every output shows true and false (states, items, views, columns, text) and whose replacement turns a number into a bool and back. Models hold bools and compare them strictly: Python's True == 1 no longer hides a 1 where a true belongs. Generated programs are typed, numbers and bools. --- examples/tasks.aup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/tasks.aup') diff --git a/examples/tasks.aup b/examples/tasks.aup index 065f649..8240348 100644 --- a/examples/tasks.aup +++ b/examples/tasks.aup @@ -5,7 +5,7 @@ use words record Task { title: text - done = 0 + done = false } state tasks: list of Task -- cgit v1.2.3