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: