;;;; A defn named after a builtin, and what the name means afterwards. ;;;; ;;;; "Allow shadowing but warn": this file's (defn get ...) is legal, it wins ;;;; at every call site in this file, and the compiler says so once at the ;;;; definition — the warning is on stderr and the exit status does not move. ;;;; ;;;; Two calls, and between them the whole rule: ;;;; ;;;; - (get p) is one argument, which the builtin get does not take. It ;;;; compiles, and it prints the field, because the name resolves to the ;;;; definition below and the builtin is not consulted about its arity. ;;;; - (shadowed/field m) reaches into the imported package, whose body calls ;;;; the builtin get on a dyn map. The shadow does not follow it there: a ;;;; package's own calls mean what they meant when the package was written. (import shadowed "pkgs/shadowed") (defstruct P [x i32]) (defn get [p P] i32 (.x p)) (defn main [] () (println (get (P {.x 7}))) (println (shadowed/field {:a 1 :b 4})))