v1.0.0 — Stable release + TUI support #8

Merged
amr merged 46 commits from feature/v0.11.0-slots into main 2026-05-12 16:34:48 -04:00
2 changed files with 18 additions and 10 deletions
Showing only changes of commit 9c879e7a97 - Show all commits

View File

@@ -93,8 +93,8 @@ the first call and frozen for subsequent calls:
The ~render-fn~ itself is returned so callers can use it inline.
The mode parameter is accepted but only respected on the first
registration for a slot. This prevents a later registration from
The mode parameter is validated on first call via ~assert~ and then
frozen for subsequent calls. This prevents a later registration from
changing the slot's semantics out from under earlier registrations.
#+BEGIN_SRC lisp :tangle ../src/components/slot.lisp
@@ -102,10 +102,14 @@ changing the slot's semantics out from under earlier registrations.
(let* ((key (string name))
(slot (gethash key *slots*)))
(if (null slot)
;; First registration — set mode and create entry
;; First registration — validate and set mode, create entry
(progn
(assert (member mode '(:stack :replace :single-winner)) ()
"Invalid slot mode: ~S (use :stack, :replace, or :single-winner)"
mode)
(setf (gethash key *slots*)
(list :mode mode
:entries (list (cons order render-fn))))
:entries (list (cons order render-fn)))))
;; Existing slot — respect frozen mode
(let ((entries (getf slot :entries)))
(ecase (getf slot :mode)

View File

@@ -8,10 +8,14 @@ Each entry: (:mode <mode> :entries <(order . render-fn) list>).")
(let* ((key (string name))
(slot (gethash key *slots*)))
(if (null slot)
;; First registration — set mode and create entry
;; First registration — validate and set mode, create entry
(progn
(assert (member mode '(:stack :replace :single-winner)) ()
"Invalid slot mode: ~S (use :stack, :replace, or :single-winner)"
mode)
(setf (gethash key *slots*)
(list :mode mode
:entries (list (cons order render-fn))))
:entries (list (cons order render-fn)))))
;; Existing slot — respect frozen mode
(let ((entries (getf slot :entries)))
(ecase (getf slot :mode)