Skip to content

Instantly share code, notes, and snippets.

@jonase
Created August 5, 2011 12:24
Show Gist options
  • Save jonase/1127420 to your computer and use it in GitHub Desktop.
Save jonase/1127420 to your computer and use it in GitHub Desktop.
; src/bar.clj
(ns bar)
(defmacro bar-macro [x]
`(inc ~x))
; src/foo.cljs
(ns foo
(:require-macros [bar :as bar]))
(defn test []
(bar/bar-macro 1))
$ 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)
...
<!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