Created
April 24, 2011 09:01
-
-
Save GeorgeJahad/939420 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 gbj2 | |
(:require gbj1)) | |
(println "gbj2") | |
(defmacro remote-declare [name] | |
"defs the supplied ns-qualified name with no bindings, useful for creating circular dependencies" | |
(let [[ns v] (.split (str name) "/") | |
orig-ns (str *ns*)] | |
`(do (in-ns '~(symbol ns)) | |
(clojure.core/declare ~(symbol v)) | |
(in-ns '~(symbol orig-ns))))) | |
(remote-declare gbj1/b) | |
(remote-declare gbj1/c) | |
(defn a [] :a) | |
(defn b [] (gbj1/b)) | |
(defn c [] (gbj1/c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment