Re: Adding load-only source files to ASDF

Richard M Kreuter <[email protected]> Wed, 14 Feb 2007 14:45:21 -0500
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
Richard M Kreuter <[email protected]> writes:

> In fact, if you're willing to use just a class, I think you can
> implement the functionality as an extension using asdf's protocols...

It occurs to me that since asdf has a load-source-op that does the
desired thing, maybe the right way to implement a load-only component
would be to have load-op depend on load-source-op for such components.
This would have the upside that source-loading would always involve an
instance of load-source-op, and so code that wants to be run whenever
source is loaded can be invoked by a method specializing on
load-source-op.

(defclass load-only-cl-source-file (cl-source-file)
  ())

(defmethod perform ((o compile-op) (c load-only-cl-source-file))
  nil)

(defmethod output-files ((o compile-op) (c load-only-cl-source-file))
  nil)

(defmethod component-depends-on ((o load-op) (c load-only-cl-source-file))
  (cons (list 'load-source-op (component-name c))
	(call-next-method)))


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV