File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1210,6 +1210,13 @@ itself (not its value) is returned. The reader macro #'x expands to (var x)."}})
12101210 [n]
12111211 `(println ~(or (source-fn &env n) (str " Source not found" ))))
12121212
1213+ (defn- named-publics-vars
1214+ " Gets the public vars in a namespace that are not anonymous."
1215+ [ns ]
1216+ (->> (ana-api/ns-publics ns )
1217+ (remove (comp :anonymous val))
1218+ (map key)))
1219+
12131220(defmacro apropos
12141221 " Given a regular expression or stringable thing, return a seq of all
12151222public definitions in all currently-loaded namespaces that match the
@@ -1224,13 +1231,13 @@ str-or-pattern."
12241231 (fn [ns ]
12251232 (let [ns-name (str ns )]
12261233 (map #(symbol ns-name (str %))
1227- (filter matches? (keys ( ana-api/ns- publics ns ) )))))
1234+ (filter matches? (named- publics-vars ns )))))
12281235 (ana-api/all-ns ))))))
12291236
12301237(defmacro dir
12311238 " Prints a sorted directory of public vars in a namespace"
12321239 [ns ]
1233- `(doseq [sym# (quote ~(sort (keys ( ana-api/ns- publics ns ) )))]
1240+ `(doseq [sym# (quote ~(sort (named- publics-vars ns )))]
12341241 (println sym#)))
12351242
12361243(defmacro pst
You can’t perform that action at this time.
0 commit comments