Skip to content

Instantly share code, notes, and snippets.

@agumonkey
Created December 18, 2018 01:25
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 agumonkey/c6e6a62f92f6f9f01aa8201b7f227cd0 to your computer and use it in GitHub Desktop.
Save agumonkey/c6e6a62f92f6f9f01aa8201b7f227cd0 to your computer and use it in GitHub Desktop.
bad helper to show a simpler table of object field members
(require '[clojure.reflect :as re]
'[clojure.pprint :as pp])
(defn j [& l]
"blend of juxt and zip . identity"
(fn [o]
(let [v ((apply juxt l) o)]
(map vector l v))))
(def u (java.net.URL. "https://www.google.com"))
(->> u
re/reflect
:members
(map (j :name :parameter-types :return-type))
(map #(into {} %))
pp/print-table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment