Skip to content

Instantly share code, notes, and snippets.

@GeorgeJahad
Created April 24, 2011 09:00
Show Gist options
  • Save GeorgeJahad/939419 to your computer and use it in GitHub Desktop.
Save GeorgeJahad/939419 to your computer and use it in GitHub Desktop.
(ns gbj1
(:require gbj2))
(println "gbj1")
(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 gbj2/a)
(defn a [] (gbj2/a))
(defn b [] :b)
(defn c [] :c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment