Created
July 21, 2010 22:38
-
-
Save bmabey/485247 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
*.sw? | |
classes | |
lib | |
*.jar |
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
Trying to see if it is possible to have circular dependencies in clojure.. | |
I don't think you can at this point, but I'd like to be proven wrong. | |
To test this out type "lein repl" and then "(require 'foo.core)". When I do this | |
I see "java.lang.Exception: No such var: foo.core/blah (bar.clj:5)" which | |
indicates a circular dependency (foo.core <--> foo.bar). | |
If you clone this gist you'll get a project to experiment in. |
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
(ns foo.bar | |
(require foo.core)) | |
(defn blah [] | |
(foo.core/blah)) | |
(defn baz [] | |
(println "Coming from foo.bar/baz")) |
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
(use 'clojure.contrib.with-ns) | |
(with-ns foo.bar | |
(declare baz)) | |
(ns foo.core | |
(require foo.bar)) | |
(defn blah [] | |
(println "Coming from foo.core/blah")) | |
(defn baz [] | |
(bar/baz)) |
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
(defproject foo "1.0.0-SNAPSHOT" | |
:description "FIXME: write" | |
:dependencies [[org.clojure/clojure "1.2.0-beta1"] | |
[org.clojure/clojure-contrib "1.2.0-beta1"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment