;;;; A package whose own bodies bind locals named after its own top-level ;;;; names. Imported, every name this file owns is rewritten to shd/name ;;;; wherever it is *used* — and a local binding shadows, so inside these two ;;;; functions the bare name is the local and must be left alone. Get that ;;;; wrong and the code still compiles and still runs; it just reads a ;;;; different variable, which is why this needs a fixture and not a refusal. (defconst limit 5) (defvar sink i32) ;;; The expression case: the body's [limit] is the let's, not the constant. (defn shadowed [] i32 (let [limit 7] limit)) ;;; The place case, which is a separate line in the renamer: [set] takes a ;;; place, and a place that is a bare name has its own shadowing check. (defn assigned [] i32 (let [sink 0] (set sink 20) sink))