On Fri, Nov 25, 2011 at 5:09 PM, Curious Fox <fra...@gmail.com> wrote:
> Do you know by any chance is there any equivalent to
> clojure.contrib.repl-utils/show in the new set of libraries?
>
> I.e. is there a standard and recommended way to inspect all object's
> properties and methods in REPL?

Take a look at clojure.reflect/reflect which returns a Clojure data
structure describing the object.

For example:

((comp (partial map :name) :members) (clojure.reflect/reflect "str"))

yields:

(valueOf java.lang.String regionMatches valueOf java.lang.String
indexOf getBytes toUpperCase lastIndexOf contentEquals endsWith
indexOf startsWith valueOf split valueOf indexOf valueOf replace
replace toLowerCase getChars java.lang.String java.lang.String
java.lang.String codePointBefore java.lang.String java.lang.String
indexOf offsetByCodePoints contains hashCode java.lang.String
compareTo toLowerCase checkBounds compareTo lastIndexOf getBytes
intern lastIndexOf getBytes replaceFirst subSequence count equals
valueOf codePointAt isEmpty valueOf getBytes lastIndexOf copyValueOf
contentEquals copyValueOf replaceAll startsWith format trim
java.lang.String getChars lastIndexOf split java.lang.String indexOf
value java.lang.String regionMatches java.lang.String substring
java.lang.String valueOf concat java.lang.String matches
java.lang.String CASE_INSENSITIVE_ORDER length charAt valueOf toString
serialVersionUID equalsIgnoreCase toCharArray hash offset
serialPersistentFields compareToIgnoreCase toUpperCase
java.lang.String format substring codePointCount)

(filter #(:static (:flags %)) (:members (reflect "str")))

will yield all the static members (with all metadata).

etc.
-- 
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)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to