Skip to content

Instantly share code, notes, and snippets.

@Hendekagon
Created May 14, 2019 08:22
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 Hendekagon/0696b859a49b2a78a28142ee6065183b to your computer and use it in GitHub Desktop.
Save Hendekagon/0696b859a49b2a78a28142ee6065183b to your computer and use it in GitHub Desktop.
Make functions public
(defn defns--
"Makes all private fns
in the namespace with the
given name public"
[namespace-name]
(doseq [[_ v]
(filter
(fn [[_ x]]
(if (var? x) (-> x meta :ns ns-name #{namespace-name}) false))
(ns-map namespace-name))]
(alter-meta! v merge {:private false})))
@Hendekagon
Copy link
Author

You've found some private functions in a namespace and you need to use them. This function fixes that namespace for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment