opening it up with Common Lisp

Favorite weblogs

Lisp Related

Bill Clementson

Finding Lisp


Planet Lisp



Talking Points Memo

This Modern World

Working for Change

Other home


Recent Readings

Book review: Darwinia
Reviewed: Friday, August 11, 2006

Summer reading: Spin
Reviewed: Saturday, August 5, 2006

Reviewed: Tuesday, July 18, 2006

the Omnivoire's Delimma
Reviewed: Wednesday, July 12, 2006

the Golem's Eye
Reviewed: Wednesday, May 31, 2006


Somewhat pointless fun: ASDF-Install dependencies
Tuesday, December 27, 2005

I realized sometime yesterday that ASDF-Install-Tester was collecting all of the information I needed to build a ASDF systems dependency graph. Here is a portion of it:

The whole thing includes only the systems that I was actually able to download but it still provides a good representation sample of the ASDF-Installable package universe. FWIW, here is the code I used to make the dot file that I gave to GraphViz.

(in-package asdf-status)

(defparameter *mcl-systems*
    (lambda (f)
      (with-open-file (in f)
            (read in nil nil)
            (when (atom it)
              (warn "Parse error: ~A" f)))
          (error () (warn "Read error: ~A" f)))))
    (directory (make-pathname
                :name :wild
                :type "ait"
                :directory `(,@(pathname-directory *input-directory*)
                :defaults *input-directory*)))))

(defparameter *dependent-systems*
   (lambda (system-info)
     (null (getf system-info :depends-on))) *mcl-systems*))

First, we read in all the system information that ASDF-Install-Tester saved in little AIT files. I just grab the OpenMCL files and filter out anything that doesn't look correct (because of ASDF-Install-Tester bugs, I suspect) and anything that has no dependencies.

(defmethod coerce-system-name ((name string))
  (string-downcase name))

(defmethod coerce-system-name ((name symbol))
  (coerce-system-name (symbol-name name)))
(defparameter *systems-graph*
  (let ((g (cl-graph:make-graph 
            'cl-graph:graph-container :vertex-test #'equal)))
    (iterate-elements *dependent-systems*
     (lambda (system-info)
       (let ((system (coerce-system-name 
                      (getf system-info :install))))
         (cl-graph:add-vertex g system)
          (getf system-info :depends-on)
          (lambda (other)
             g (coerce-system-name other) system
             :edge-type :directed))))))

(cl-graph:graph->dot *systems-graph* 
 (lambda (v s) (princ (element v) s))
 (lambda (v s) 
   (format s "URL=\"\""
           (element v))))

Then we can build the graph and output to a dot format.


Home | About | Quotes | Recent | Archives

Copyright -- Gary Warren King, 2004 - 2006