;;;; v5 is v4 with one difference: [extra] is an i32 rather than an i64. ;;;; ;;;; [extra] does not exist in the host — v3 introduced it at run time, so its ;;;; storage was allocated by runtime/flan_dev.c the first time a module asked ;;;; for it, and every later module that mentions the name is handed back that ;;;; same allocation. Handing it back for a differently shaped type is layout ;;;; drift: the new body would read and write at offsets the old allocation was ;;;; never laid out for, and nothing downstream could ever say so. The registry ;;;; compares the size it recorded against the size it is asked for and aborts ;;;; instead — retyping a var needs a restart, and this is the file that says ;;;; the guard is real. ;;;; ;;;; Loaded on top of v3, and never alongside v4: the process it aborts is the ;;;; whole of the test. (defvar counter i64) (defvar extra i32) (defn helper [x i64] i64 (* x 2)) (defn added [] i32 (set extra (+ extra 100)) extra) (defn bump [] i64 (println "v5") (set counter (+ counter (i64 (added)))) (helper counter)) (defn outer [] i64 (bump))