Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Rename uber-flatten to symbols-in-body.

  • Loading branch information...
commit f96e740f5d5b354c6db794e279d569fa78c4c377 1 parent 7106122
@technomancy authored
Showing with 5 additions and 9 deletions.
  1. +5 −9 src/slam/hound/regrow.clj
14 src/slam/hound/regrow.clj
@@ -44,19 +44,15 @@
(remove-ns (.name *ns*)))))))
-(defn- uber-flatten
- "Like flatten but will flatten into anything that is a coll?,
- which means we can flatten namespace bodies that contain sets and maps."
- [x]
- (filter (complement coll?)
- (rest (tree-seq coll? seq x))))
+(defn- symbols-in-body [body]
+ (filter symbol? (remove coll? (rest (tree-seq coll? seq body)))))
(def ^:private ns-qualifed-syms
(memoize (fn [body]
(apply merge-with set/union {}
- (for [value (uber-flatten body)
- :when (symbol? value)
- :let [[_ alias var-name] (re-matches #"(.+)/(.+)" (str value))]
+ (for [value (symbols-in-body body)
+ :let [[_ alias var-name] (re-matches #"(.+)/(.+)"
+ (str value))]
:when alias]
{alias #{(symbol var-name)}})))))
Please sign in to comment.
Something went wrong with that request. Please try again.