Skip to content

Instantly share code, notes, and snippets.

@ivermac
Created September 1, 2018 12:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ivermac/6d56e2da734d8f6b5960f89934fbce69 to your computer and use it in GitHub Desktop.
Save ivermac/6d56e2da734d8f6b5960f89934fbce69 to your computer and use it in GitHub Desktop.
Clojure Type Reflection

Found clojure type reflection useful when using java objects in clojure. Especially in the repl

(use 'clojure.pprint 'clojure.reflect)
(def object-members (:members (reflect <object>)))
(print-table [:name :type :flags] (sort-by :name object-members))

The official documentation is here

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