(defn gen-constant-id [value]
(let [prefix (cond
(keyword? value) "cst$kw$"
(symbol? value) "cst$sym$"
:else
(throw
#?(:clj (Exception. (str "constant type " (type value) " not supported"))
:cljs (js/Error. (str "constant type " (type value) " not supported")))))
name (if (keyword? value)
(subs (str value) 1)
(str value))
name (if (= "." name)
"_DOT_"
(-> name
(string/replace "-" "_DASH_")
(munge)
(string/replace "." "$")
(string/replace #"(?i)[^a-z0-9$_]" #(hex-format % 4))))]
(symbol (str prefix name))))