Sure. I uploaded a minimal project here: http://dl.dropbox.com/u/30225560/macros.tar.gz
The build.sh script just sets up the classpath as I didn't want any additional dependencies on lein etc. The global classpath is properly set up with clojure on it, $CLOJURRESCRIPT_HOME is set up as well. Here is what happens: * no (:require-macros ...) $ ./build.sh /Users/phil/Projects/clojure-1.3.0:./src WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. (js-keys hashobj) sort) is no longer a property access. Maybe you meant (. (js-keys hashobj) -sort) instead? WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. (js-keys hashobj) sort) is no longer a property access. Maybe you meant (. (js-keys hashobj) -sort) instead? $ ls -la out/base/ total 8 drwxr-xr-x 3 phil staff 102 Jan 27 18:12 ./ drwxr-xr-x 5 phil staff 170 Jan 27 18:12 ../ -rw-r--r-- 1 phil staff 185 Jan 27 18:12 core.js (BTW what are those warnings? I haven't compiled directly from the cmd line for a while now and don't remember them. Maybe they have something to do with all this?) core.js is generated properly. * now with (:require-macros ...) $ ./build.sh /Users/phil/Projects/clojure-1.3.0:./src WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. this toString) is no longer a property access. Maybe you meant (. this -toString) instead? WARNING: The form (. (js-keys hashobj) sort) is no longer a property access. Maybe you meant (. (js-keys hashobj) -sort) instead? Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate base/ macros__init.class or base/macros.clj on classpath: ... stacktrace Now the plot thickens. base/macros.clj *should* be on the classpath but the Clojure compiler can't find it. When I build again (with NO modifications to ANYTHING whatsoever): $ ./build.sh /Users/phil/Projects/clojure-1.3.0:./src $ It suddenly works! This is reproducible - invoking ./build.sh throws an exception the first time and "succeeds" on the second when (:require-macros ...) is included. By "succeeds" I mean the following: $ ls -la out/base/ total 0 drwxr-xr-x 3 phil staff 102 Jan 27 18:12 ./ drwxr-xr-x 5 phil staff 170 Jan 27 18:12 ../ -rw-r--r-- 1 phil staff 0 Jan 27 18:16 core.js i.e. core.js is empty. Very strange. On Jan 27, 5:16 pm, David Nolen <dnolen.li...@gmail.com> wrote: > On Fri, Jan 27, 2012 at 1:26 AM, philip k <trevo.pa...@gmail.com> wrote: > > Hi, I'm using cljs-watch to cross compile generic Clojure code into > > both class files and js files using the latest master Clojurescript > > checkout; this all works wonderfully until I try to add a (:require- > > macros ...) directive as follows: > > > // in xyz.base.view > > > (ns xyz.base.view > > (:require ... > > (:require-macros [hs.base.macros :as monads])) > > > // in xyz.base.macros > > > (ns hs.base.macros) > > > in which case the compiled xyz/base/view.js file is empty (0 bytes) > > and the Clojurescript compiler doesn't produce any errors. When I > > remove the (:require-macros ...) directive the js file is generated as > > expected. > > > Has anyone encountered a similar problem? Many thanks for any advice! > > Can you create a minimal test case with all the involved files and paste > that somewhere? What is the hs.base.macros dependency? > > David -- 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