;;;; v4 redefines only [added] — itself introduced at run time by v3, so it ;;;; lives in the registry and not in any symbol table. ;;;; ;;;; This is the case that separates a real implementation from a plausible ;;;; one. v3's [bump] is already installed and is not rebuilt here, so it picks ;;;; this up only if its call to [added] goes through a *cell* that both ;;;; modules found by name. Had v3 cached the address of the function instead ;;;; of the address of its cell, everything else would still pass and this ;;;; would silently keep running v3's [added]. (defvar counter i64) (defvar extra i64) (defn helper [x i64] i64 (* x 2)) (defn added [] i64 (set extra (+ extra 100)) extra) (defn bump [] i64 (println "v3") (set counter (+ counter (added))) (helper counter)) (defn outer [] i64 (bump))