Hey,
I'm honestly not quite sure what you are asking but maybe I can shed some light
on the way the ClojureScript compiler handles Clojure code (ie. macros).
Whenever the cljs.analyzer reads a (ns ...) form and encounters anything that
mentions a macro, like
(:require-macros [some.ns :refer (my-macro)])
(:require [some.ns :include-macros true])
(:require [some.ns :refer-macros (my-macro)])
It will 'clojure.core/require the corresponding Clojure Namespace ('some.ns in
my example), normal Clojure loading rules apply so everything is loaded (if
there is a defmethod it will be eval'd).
Now, my guess is that you want to load a Clojure file without a corresponding
ClojureScript file? Say, a bunch of (defmethod assert-expr ...)?
Option #1: Create an empty ClojureScript (ns ...) with the same name as the
Clojure Namespace and (:require [some.ns :include-macros true]).
Option #2: Create an empty ClojureScript (ns ... (:require-macros
[my.clojure-ns])) and require it as normal in CLJS
Option #3: Just (:require-macros [my.clojure-ns])
Option #4: Could be achieved with shadow-build but I wouldn't recommend it
since it would only work with YOUR build configuration.
The gist is that ClojureScript must be told to load a Clojure file, it can't
figure this out by itself.
(ns my-app.my-tests
(:require-macros [my-app.test-utils])
(:require [clojurescript.test]))
Note that you don't actually have to define any macros, the 'ns will be
required nonetheless. Its basically just a way to tell the cljs compiler that
there is some clojure code we want loaded.
HTH,
/thomas
--
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 http://groups.google.com/group/clojurescript.