The script is in tools/ rather than thrown away, because two lanes are
writing Flan in the old spelling right now and their files need the same
pass at merge.
It works on forms, not on text: a keyword becomes a dot only where it sits
in a field-label position inside a brace, so an enum member in value
position, a map key inside an EDN string and a type-position {K V} are all
left alone. :keys keeps its colon -- it names no field.
17 lines
505 B
Plaintext
17 lines
505 B
Plaintext
(defstruct AssetMissing [id i32])
|
|
|
|
(defvar seen i64)
|
|
|
|
(defn load-all []
|
|
(signal (AssetMissing {.id 1})) ; Unit — the caller carries on
|
|
(signal (AssetMissing {.id 2})))
|
|
|
|
(defn main []
|
|
(load-all) ; no handler: a no-op
|
|
(print seen) (println "") ; 0
|
|
|
|
;; A handler that returns normally accumulates and lets the signaller run on.
|
|
(handler-bind [(AssetMissing [c] (set seen (+ seen (i64 (.id c)))))]
|
|
(load-all))
|
|
(print seen) (println "")) ; 3
|