On Wednesday, 18 February 2015 04:13:08 UTC+10, David Nolen wrote: > On Tue, Feb 17, 2015 at 12:51 PM, Roberto Oliveros <roberto...@mac.com> wrote: > > > > > > (ns your-users.namespace > > (:require [mylib.core :include-macros true])) ;; if they want to include all > > ;; macros > > > > This bit is no longer necessary in 0.0-2850 if the library ns requires a > macro ns of the same name: > > > (ns your-users.namespace > (:require [mylib.core :as mylib])) > > > Is all users need, they can drop `:include-macros true` as it's implied in > this case. > > > > (ns your-users.namespace > > (:require [mylib.core :refer-macros [your-macro-1 your-macro-2 ...]])) > > > > Hope it helps.
In 2012 on the Clojure list, there was a conversation about cljs files sharing the same name with clj macro files. http://grokbase.com/t/gg/clojure/129d4g0ppq/macros-shadowing-defn-in-clojurescript-akin-to-definiline I tried essentially the same code with the current version of clojurescript. ;; In src/cljs/fancy/core.cljs: (ns fancy.core (:require [fancy.fancy :as fancy]) (:require-macros [fancy.fancy :as fancy])) (defn incljs [] (js/alert (apply fancy/fun ["cljs non macro"]))) (defn inclj [] (js/alert (fancy/fun "clj macros")) ) ;; In src/cljs/fancy/fancy.cljs: (ns fancy.fancy) (defn fun [x] [:runtime :fun x]) ;; In src/clj/fancy/fancy.clj: (ns fancy.fancy) (defmacro fun [x] [:precompiled :fun x]) ;; fancy.html <html> <body> <button onclick="fancy.core.incljs()">CLJS</button> <button onclick="fancy.core.inclj()">CLJ</button> <script src="resources/public/js/fancy.js"></script> </body> </html> When I run this, I get the :runtime output from the CLJS button, and the :precompiled output from the CLJ button. However, if I remove the :require-macros form from core.cljs I get the :runtime output from both. Is this as expected? -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.