;;;; A dyn's .field and [:key] trap with get's and put's own sentences, one ;;;; per run. The argument chooses which; the test asserts the line numbers. (defclass State [paused bool step bool]) (defn as-dyn [d dyn] dyn d) (defn main [args [string]] i32 (let [which (if (> (length args) 1) (i32 (bytes->i64 (bytes-view (at args 1)))) 0) s (State false false) n (as-dyn 3)] (println "before") (cond (= which 0) (println (.paused n)) (= which 1) (set (.paused s) 1) (= which 2) (set (.paused n) true) (= which 3) (set (at s :step) 2) :else (println (at n :paused)))) 0)