Also in the last release: I finally decided how to deal with dynamic vars and ESM. Squint regards *foo* (earmuffed) variable names always as dynamic and compiles and and runtime accesses / sets! them as mutable boxes. They are right now just an object with a val field (well, value in the last release, but I'm renaming this).
Note that this was a problem since ESM exported values are not mutable in JS. Since earmuffing can be inspected statically, squint can still compile namespaces quite independently without having knowledge about the whole program.
(def ^:dynamic *foo* 1)
[(binding [*foo* 2]
*foo*) *foo*]
;;=> [2 1]
Compiled as:
var _STAR_foo_STAR_ = { val: 1 };
[
(() => {
const binding__21 = _STAR_foo_STAR_.val;
_STAR_foo_STAR_.val = 2;
return (() => {
try {
return _STAR_foo_STAR_.val;
} finally {
_STAR_foo_STAR_.val = binding__21;
}
})();
})(),
_STAR_foo_STAR_.val,
];https://clojurians.slack.com/archives/C015AL9QYH1/p1782394188485229