Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Examples that currently fail:

`
(ns a-b.core)
(defn doit [])

(ns a-b.other
(:require [a-b.core :as core]))

(let [a_b 2]
(core/doit)) ;; FAILS, a_b isn't shadowed properly

;; Related:
(let [a_b 1, a-b 2] a_b) ;; Collide, returns 2!
(let [a-b 1, a_b 2] a-b) ;; Collide, returns 2!
(let [goog "2"] (js-obj goog 2) ;; Fails. Overrides goog!

`

Given the shadowing logic of the compiler is pretty expensive and further dynamically computing the munged name of each "first namespace segment" could potentially slow down the compiler by a factor of 2x (or more) we should probably re-introduce this approach:

https://github.com/clojure/clojurescript/commit/1c71ab3bff27dc4a099b06e122ec3fdf5a2a8ba8

Ie, maintaining a set of first ns segments and do s simple set lookup in shadow-depth. We should probably only store munged names and do the lookup after munging to fix the above bugs. We should also add "goog".

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2461 (reported by aralo)
...