;;;; A program to set a breakpoint in, for driving `C-u C-c C-c' from an editor. ;;;; ;;;; Unlike dev-break.flan it does not stop on its own: it starts running and ;;;; keeps running, because the claim being tested is that marking a form is ;;;; what stops it. Anything already stopped would prove nothing. ;;;; ;;;; What it needs is a function that keeps being called, so that a mark set ;;;; after startup is hit, and hit again after the mark is cleared. dev-loop.flan ;;;; calls [step] four times, which is too tight for that; this is dev-break.flan's ;;;; tail with nothing in front of it. (import agent "vendor:agent") (defvar ticks i64) ;;; Something to stop on that is *not* a breakpoint, so that a marked ;;; expression sent to an already-stopped program can be told from the break it ;;; was already sitting in. It is here rather than in an evaluated form for the ;;; reason dev-loop.flan gives: the break loop matches on a class the host was ;;; compiled with. (defstruct Missing [id i32]) (defn boom [] i64 (restart-case (do (error (Missing {.id 1})) 0) (carry-on [] -1))) (defn step [] i64 (set ticks (+ ticks 1)) ticks) (defn main [] i32 (agent/start "/tmp/flan-dev-pause-fallback.sock") (dotimes [i 4000] (agent/wait 5) (set ticks (step))) 0)