squint 2025-08-25

maybe mutable vars in squint wouldn't be so bad after all? it will have an impact on bundle size... but at least binding will work since you can mutate shit in ES modules this way for REPL it won't be a solution since ES modules themselves are still immutable https://clojurians.slack.com/archives/C061V0G8Z/p1756134459403209

that will only work when you are setting something in the same namespace

e.g. (binding [foo/bar ...]) won't work due to ES module limitations

👍 1

maybe an intermediate solution would be to just do this for dynamic vars... but then you'd have to track which things are dynamic vars

When I was hacking on the mr-clean-in-squint thing the LLM suggested an implementation for binding which was basically wrapping everything in a try-finally. Not sure if that's relevant to what you're saying.

🧟‍♂️ 1

This but in js:

(let [old-watcher *watcher*]
  (try
    (set! *watcher* new-watcher)
    ;; ... body where *watcher* has the new value ...
    (finally
      (set! *watcher* old-watcher))))
I guess the problem is when there are consts?