flan/test/programs/error.flan
Joseph Ferano 9a820d86cd Sweep every field label from the colon spelling to the dot
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.
2026-09-12 14:47:54 +07:00

15 lines
612 B
Plaintext

;;;; An unhandled (error c) — spec-conditions.md §2.
;;;;
;;;; Its argument is the whole of the difference from signal: a handler that
;;;; returns normally has not answered an error, so with nothing transferring
;;;; the program stops and says which condition it was. In a dev build this is
;;;; where the break loop will go.
(defstruct AssetMissing [id i32])
(defn main [] i32
;; A handler that returns normally. It runs — signal's lookup is the same —
;; and it still does not answer the error.
(handler-bind [(AssetMissing [c] (println "handler ran"))]
(error (AssetMissing {.id 1})))
0)