require and asdf

Robert Goldman <[email protected]> Sun, 22 Apr 2007 09:47:29 -0500
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
There was a discussion a while ago about how to have requirements in
asdf.  Here's an old kludge I wrote to have requirements that did NOT
necessarily get loaded just when you load the system definition file.

I wrote this a very long time ago, and see some wrongnesses already
(e.g., the handling of the module-name is no good for use with Franz'
mlisp).  So, strictly FWIW (made available according to the lisp LGPL).

Best,
Robert

;;; REQUIREMENTS:

(defclass requirement (component)
     ()
  )

(defmethod module-name ((c requirement))
  (intern (string-upcase (component-name c)) (find-package "KEYWORD")))

(defmethod perform ((operation compile-op) (c requirement))
  (require (module-name c))
  nil)

(defmethod perform ((operation load-op) (c requirement))
  (require (intern (component-name c) (find-package "KEYWORD")))
  nil)

(defmethod check-requirement ((c requirement))
  (member (module-name c) *modules*))

(defmethod operation-done-p ((operation load-op) (c requirement))
  (check-requirement c))

(defmethod operation-done-p ((operation compile-op) (c requirement))
  (check-requirement c))

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/