Skip to content

Instantly share code, notes, and snippets.

@stathissideris
Created June 6, 2018 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stathissideris/ac4d64e2d014af3ac9644855beaa15c7 to your computer and use it in GitHub Desktop.
Save stathissideris/ac4d64e2d014af3ac9644855beaa15c7 to your computer and use it in GitHub Desktop.
Alias Clojure namespace without requiring it (helps with long namespaced keywords)
(defn ensure-namespace-alias [ns alias-sym]
(when-not (find-ns ns)
(create-ns ns))
(alias alias-sym ns))
(ensure-namespace-alias 'this.is.a.long.namespace 'long)
::long/foo => :this.is.a.long.namespace/foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment