From 15f0114d6a7da0a4f63028db12cac62c5f9cc922 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 28 Sep 2026 05:01:23 +0100 Subject: Give an event locals LOCAL_LOAD and LOCAL_STORE name one of an event's 64 slots, what it holds (a number, or an index of a list) and that list: slots start at 0 when an event begins, are shared by its handlers, the walks in them and the folds in those, and are never saved nor in the states' namespace. A handler uses a slot for one thing, so its type is verified as a state's is; views have no locals (IN_LOCALS: a handler's block, a walk in it, a fold in either; stores only in a handler and its walks). A fold reading a local still runs a leaf at a time (one value for every item) and a shaped fold takes one only on its key's side. The signature table's where widens to 16 bits. locals checks a handler that sums items into a local in a walk, counts in a fold the items below it, keeps an index in a local and reads it back, over 80 events against a model, and five refusals. server_rows' shop now takes stock through an index local and counts in one. --- tests/check.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/check.py b/tests/check.py index 2020363..4387120 100644 --- a/tests/check.py +++ b/tests/check.py @@ -1059,12 +1059,15 @@ on restock { } } on order { + let taken = 0 for l in order.lines { - stock[l.item].left = stock[l.item].left - l.qty - require stock[l.item].left >= 0 + let s = stock[l.item] + s.left = s.left - l.qty + require s.left >= 0 log.append(Entry { item: l.item, qty: l.qty, note: l.note }) + taken = taken + 1 } - orders = orders + order.lines.count + orders = orders + taken } on clean { for s in stock where s.left < clean.below { -- cgit v1.2.3