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. --- core/module.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/module.h') diff --git a/core/module.h b/core/module.h index 0b20a9f..b8f8e98 100644 --- a/core/module.h +++ b/core/module.h @@ -39,8 +39,16 @@ typedef enum { PURE_OP_INDEX_MOVE, PURE_OP_INDEX_FIRST, PURE_OP_INDEX_LAST, PURE_OP_INDEX_NUM, PURE_OP_ROW, PURE_OP_PICK, PURE_OP_SLIDE, PURE_OP_FOLD, PURE_OP_TEXT_COMPARE, PURE_OP_LIST_FIND, PURE_OP_LIST_HAS, PURE_OP_NOW, PURE_OP_FLOOR, PURE_OP_MOD, PURE_OP_SEND, PURE_OP_OUTER_ROW, PURE_OP_EACH, + PURE_OP_LOCAL_LOAD, PURE_OP_LOCAL_STORE, PURE_OP_COUNT } PureOpcode; +/* A local: one of an event's PURE_MODULE_LOCALS slots, 0 when the event + * begins and never saved. LOCAL_LOAD and LOCAL_STORE name the slot (bits + * 0-7), what it holds (bits 8-15: 0 a number, 1 an index) and an index's + * list (bits 16-31); a handler uses a slot for one of them. A handler, the + * walks in it and the folds in those read locals; the handler and its walks + * store them. */ +enum { PURE_MODULE_LOCALS = 64 }; /* EACH's argument: the list state (bits 8-15) and the length of the block * that follows (16-31), run in a handler once for every item the list had * when it began, in order, with ROW the item; the block may change states, -- cgit v1.2.3