Skip to content

Instantly share code, notes, and snippets.

@arohner
Created January 15, 2013 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arohner/4534779 to your computer and use it in GitHub Desktop.
Save arohner/4534779 to your computer and use it in GitHub Desktop.
analyze.core :refer trouble
;; 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