|Paolo Amoroso's weblog. Main interests: Lisp, astronomy (Moon), space exploration (Apollo and early manned programs)||Calendar of past entries | Related links|
Package hierarchy graphs with McCLIM's listener
Graphs often make for cool screen shots. So, I have written a couple of new McCLIM listener commands for displaying package hierarchy graphs.
implements the commands
Show Package Users and
Used Packages for drawing graphs of, respectively, the packages
that use the argument package and the ones used by it. Both commands
take a single optional argument, a package name (string) or a package.
The default is the value of
Each node contains the package name followed by a pair of numbers in
parentheses, the number of internal and external symbols, like this:
If the package has no external symbols, the node is gray.
The screen shots below show sample output of these commands in a
typical CMUCL image with McCLIM and other tools (SLIME and ASDF) under
EXTENSIONS is an implementation-specific CMUCL
package. Playing with such graphs is interesting, they
unearth complex relationships among packages.
The code, which you can compile and load into the listener, is based
on the listener's class graphing function and commands. The new
commands call the CLIM grapher with appropriate arguments, i.e.
functions for generating the children of a node:
cl:package-used-by-list in this case. If you don't use
CMUCL, be sure to customize
count-external-symbols for your Lisp.
If these commands are ever added to the listener's CVS sources, it may be worth considering factoring the class/package graphing functionality.
|Copyright © 2004 by Paolo Amoroso
Created with BlogMax
|About Lisp | Practical Common Lisp (learn Lisp) | Planet Lisp (blog agregator) | Common Lisp Directory (software and resources) | Why Lisp?|