This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-11
Channels
- # adventofcode (31)
- # announcements (6)
- # babashka (5)
- # beginners (93)
- # calva (15)
- # cider (20)
- # cljs-dev (16)
- # clojure (159)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (9)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (26)
- # clojure-spec (7)
- # clojure-uk (33)
- # clojurescript (54)
- # clojutre (5)
- # cursive (20)
- # datomic (23)
- # emacs (19)
- # events (1)
- # expound (1)
- # figwheel-main (1)
- # fulcro (104)
- # hyperfiddle (1)
- # jobs (1)
- # luminus (10)
- # malli (59)
- # nrepl (1)
- # off-topic (11)
- # pathom (5)
- # planck (15)
- # reagent (13)
- # reitit (8)
- # rewrite-clj (10)
- # ring-swagger (3)
- # shadow-cljs (129)
- # tools-deps (46)
- # xtdb (14)
- # yada (1)
we’re using this macro in Clojure to use namespaced keywords throughout our codebase while avoiding circular deps.
(defmacro ns-alias
"Set up a custom alias for use with namespace keywords.
(ns-alias com.nextjournal.journal.system sys)"
[ns as]
`(do
(create-ns '~ns)
(alias '~as '~ns)))
now we’re trying to add cljs support for this but there’s not alias
there. Is there a workaround for this?
you could just not use aliases?
@alexmiller of course but that’s quite tedious to spell out or I don’t understand what you mean
@dnolen thanks, will consider that. But there’s also no particular reason why alias
couldn’t be added?
fyi, this is an area we might add a lightweight alias support (not requiring namespace creation/use) to Clojure (and ClojureScript) in future
there's nothing prevent alias
but it's really annoying - not hard but you need to follow the rules for top-level require