;;;; A run-time-new global with a value of its own, which is the half of the ;;;; new-name path that a zeroed defonce cannot measure: [flan_dev_global] ;;;; allocates with calloc, so a global declared zero looks right whether or ;;;; not its initial value travelled with the module. [tuning] is 42, and the ;;;; transcript is the number the host prints, so an image that never arrived ;;;; prints 4 rather than 88. ;;;; [dial] is the same claim for the other mutable form, and it is the one ;;;; that needs saying: every def initialiser is lifted into [global/] so ;;;; that re-evaluating the form can swap it through a cell, which means a ;;;; def's own [ginit] is a *call* and never a constant. A backend that asked ;;;; [Tast.const_init] about it — both of them did — would send a null image ;;;; and this global would be 0 for the life of the process, with no startup ;;;; in the host to ever put 5 there. [Emit.initial_image] reads the constant ;;;; back out of the lifted body, and this transcript is the x86 backend ;;;; running that answer rather than a disassembly agreeing with it. (defonce counter i64) (defonce tuning i64 42) (def dial i64 5) (defn helper [x i64] i64 (* x 2)) (defn bump [] i64 (println "v6") (set counter (+ counter tuning dial 1)) (helper counter)) (defn outer [] i64 (bump))