On Tuesday, 19 February 2013 03:20:49 UTC-7, Stuart Campbell wrote:
>
> Say I have some namespace that looks like this:
>
> (ns util.logging)
>
> (defn log* [priority generate-message]
>   (if (loggable? priority)
>     (write-log (generate-message))))
>
> I also have some convenience macros that reference the functions in that 
> namespace:
>
> (ns util.logging-macros)
>
> (defmacro debug [msg]
>   `(foo.logging/log* :debug (fn [] ~msg)))
>
> If I want to be able to use the debug macro, I have to ensure that the 
> util.logging ns is loaded. I'm currently doing this manually:
>
> (ns foo
>   (:require [util.logging :as logging])
>   (:require-macros [util.logging-macros :as log]))
>
> (log/debug "Hello")
>
> Is there a way to ensure util.logging is always required along with 
> util.logging-macros?
>

The recommended way to do this with a modern (circa 2017) ClojureScript is 
described 
here: https://groups.google.com/d/msg/clojurescript/o0Q8Gs_0HYQ/yv0NgDD1BgAJ

I appreciate that necroposting is considered gauche, but this post is still 
a top hit on Google when searching on this topic, and hopefully I can spare 
others the hours that I spent trying to figure this out.

.M

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to