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.
32 lines
1015 B
Plaintext
32 lines
1015 B
Plaintext
;;;; What [flan dev] launches: a program with a loop, a function to redefine,
|
|
;;;; and a way to stop. The daemon overrides the socket path through the
|
|
;;;; environment, so the one written here is only what it falls back to.
|
|
(import agent "vendor:agent")
|
|
|
|
(defvar ticks i64)
|
|
|
|
;;; A condition and something that signals it, so that a body typed in later
|
|
;;; can establish a handler and transfer past this frame — spec-conditions.md
|
|
;;; §6. It is here rather than in the evaluated form on purpose: the guard that
|
|
;;; forwards the transfer has to be one the *host* was compiled with.
|
|
(defstruct Missing [id i32])
|
|
|
|
(defn probe [] i64
|
|
(signal (Missing {.id 1}))
|
|
0)
|
|
|
|
(defn step [] i64
|
|
(set ticks (+ ticks 1))
|
|
ticks)
|
|
|
|
(defn main [] i32
|
|
(agent/start "/tmp/flan-dev-fallback.sock")
|
|
(print (step)) (println "")
|
|
(while (= (agent/wait 100) 0) 0)
|
|
(print (step)) (println "")
|
|
(while (= (agent/wait 100) 0) 0)
|
|
(print (step)) (println "")
|
|
(while (= (agent/wait 100) 0) 0)
|
|
(print (step)) (println "")
|
|
0)
|