I'm curious why the "show" function got abandoned when migrating from monolithic
contrib.repl-utils to clojure.repl?
http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
It looks like it would have been useful. Does anything replace it?
Thanks.
-ken
clojure.reflect/reflect gets you the same information as a big 'ole data structure. You can pprint it for readability.
The only thing that was not ported was the formatted text output, which would be easy enough to reproduce based on `reflect`.
=> (require 'clojure.reflect)
nil
=> (require 'clojure.pprint)
nil
=> (clojure.pprint/print-table (clojure.reflect/reflect Math))
ClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry clojure.lang.APersistentMap$KeySeq.first (APersistentMap.java:132)
But reflect is useful enough just as a map, so problem solved, thanks!
-ken
print-table expects a sequence of maps, e.g.
(print-table (:members (reflect Math)))
or
(print-table (:members (reflect Math :ancestors true)))
to include inherited members.
Sincerely,
Michał
Wow! I had no idea how useful that could be... Learn something new
every day! (and, lately, that's a new Clojure function every day...)
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
That is amazing! Thanks for the tip Michał!
-John
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en