Created
January 15, 2013 00:08
-
-
Save arohner/4534779 to your computer and use it in GitHub Desktop.
analyze.core :refer trouble
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
;; File 1 | |
(ns foo.bar | |
;; any :use or :refer is acceptable here, as long as the refer'd fn is not present in the user namespace (or wherever analyze is run from) | |
(:require [clojure.set :refer (intersection)])) | |
(defn foo [x y] | |
(intersection x y)) | |
;; at the repl | |
user> (require '[analyze.core :as analyze]) | |
(defn analyze [nsym] | |
(with-open [pushback-reader (analyze/pb-reader-for-ns nsym)] | |
(binding [*ns* (find-ns nsym)] | |
(analyze/analyze-ns pushback-reader (analyze/uri-for-ns nsym) nsym)))) | |
(analyze 'foo.bar) ;; works, as long as the (binding [*ns..]) is present. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment