In version 10.1, I've built something like Spelunk into GeneralUtilities`
.
To use it, run
Needs["GeneralUtilities`"]
PrintDefinitions[symbol];
This will pop up a window that shows all definitions of symbol. Here is a short summary of features:
- The window shows code cells containing all
DownValues
,OwnValues
,UpValues
,SubValues
, andAttributes
of a symbol. - Most pathological kinds of
StandardForm
are avoided, so thatImage
,Graphics
,Row
,Column
,SparseArray
, etc. will show up as code, not UI elements. This is achieved via thePlainForm
andCodeForm
wrappers, which can also be found inGeneralUtilities`
. - Hyperlinks are be injected as appropriate. Click on a hyperlinked symbol to print its definitions in a new window.
- The
CellContext
of each code cell is set to reduce the amount of clutter from fully qualified private symbols etc. For symbols outside this context, the name is shown, the fully qualified name is tooltipped, and color coding is used: symbols in conventional private contexts like`Private`
are brown/orange; system symbols are black; other symbols are dark gray if on the context path, otherwise light gray.
Here's a simple example of PrintDefinitions
running on itself: