The analyzer punted set! as uncompilable. Add it as a special form: (set! sym val) on a var emits jolt-var-set, which updates the innermost thread binding (or the root when unbound), returning val. A local target (deftype mutable field) or an interop (.-field) target stays uncompilable for now. Also defines *warn-on-reflection* (false) so set! on it resolves. SCI load 186 -> 196/218.
18 lines
945 B
Scheme
18 lines
945 B
Scheme
;; dynamic vars — the handful of clojure.core dynamic vars that aren't emitted into
|
|
;; the prelude. These two are plain constants; *ns* (a namespace object) needs a
|
|
;; value type with get-see-through and map?=false and is tracked separately. Loaded
|
|
;; from rt.ss after the value model + def-var!.
|
|
|
|
;; *clojure-version* — a map {:major 1 :minor 11 :incremental 0 :qualifier nil}.
|
|
(def-var! "clojure.core" "*clojure-version*"
|
|
(jolt-hash-map (keyword #f "major") 1
|
|
(keyword #f "minor") 11
|
|
(keyword #f "incremental") 0
|
|
(keyword #f "qualifier") jolt-nil))
|
|
|
|
;; *unchecked-math* — jolt does no unchecked-math elision; the var reads false.
|
|
(def-var! "clojure.core" "*unchecked-math*" #f)
|
|
|
|
;; *warn-on-reflection* — jolt has no reflection, so the var reads false; (set!
|
|
;; *warn-on-reflection* …) resolves and updates it (a no-op effect).
|
|
(def-var! "clojure.core" "*warn-on-reflection*" #f)
|