Created
August 5, 2011 12:24
-
-
Save jonase/1127420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; src/bar.clj | |
(ns bar) | |
(defmacro bar-macro [x] | |
`(inc ~x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; src/foo.cljs | |
(ns foo | |
(:require-macros [bar :as bar])) | |
(defn test [] | |
(bar/bar-macro 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cljsc src/ > foo.js | |
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate bar__init.class or bar.clj on classpath: | |
at clojure.lang.Util.runtimeException(Util.java:153) | |
at clojure.lang.Compiler.eval(Compiler.java:6417) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script type="text/javascript" src="out/goog/base.js"></script> | |
<script type="text/javascript" src="foo.js"></script> | |
<script> | |
goog.require('foo'); | |
</script> | |
<script> | |
alert(foo.test()); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment