On 9 Mar 2010, at 01:01, Mark Derricutt wrote:

I know we've changed around how clojure:test runs under 1.3.2-SNAPSHOT
and I half expected the build to fail, but this wasn't the failure I
expected to see.  Anyone have any idea whats going on here?  It has me
stumped at the moment...

Is this a problem with clojure-contrib, or how the plugin is
bootstrapping things?

I wrote that code, so perhaps I can contribute to solving that problem, but unfortunately I don't know anything at all about the Maven plugin and what it does to run tests.

From the failure message it seems that the symbol macro in the test is not expanded at all. It is unlikely that the failure is due to the macro with-symbol-macros, because that would probably cause other tests in the same test suite to fail as well. I suspect that the symbol macro is not recognized as such because of some problem with metadata handling. Here is how symbol macros are defined:

(defmacro defsymbolmacro
  "Define a symbol macro. Because symbol macros are not part of
   Clojure's built-in macro expansion system, they can be used only
   inside a with-symbol-macros form."
  [symbol expansion]
  (let [meta-map (if (meta symbol) (meta symbol) {})
        meta-map (assoc meta-map :symbol-macro true)]
  `(def ~(with-meta symbol meta-map) (quote ~expansion))))

A symbol macro is a symbol whose value is its expansion and whose metadata map includes {:symbol-macro true}. The macro expansion code checks for that metadata tag. If it doesn't find it, it doesn't expand anything, which happens to be the observed behaviour in that test.

Konrad.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to