adding system-loaded-p to ASDF

Gary King <[email protected]> Wed, 15 Oct 2008 15:01:23 -0400
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
AFAIK, there is no _easy_ way to tell if a system has been loaded in  
ASDF. #'find-system lets me know if a system is defined but I have to  
look at operation-done-p to know whether or not it has been loaded.  
The following adds #'system-loaded-p and two methods on #'operation- 
done-p to make it easier to use by converting symbols into instances  
of reasonable classes.

(in-package #:asdf)

(defmethod operation-done-p ((o symbol) (c t))
  (operation-done-p (make-instance o) c))

(defmethod operation-done-p ((o t) (c symbol))
  (operation-done-p o (find-system c)))

(defun system-loaded-p (system)
  (operation-done-p 'load-op (find-system system)))

If there is no disagreement, I'll add some documentation and tests and  
commit.
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/