Re: Adding load-only source files to ASDF

Richard M Kreuter <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
Gary King <[email protected]> writes:

> Load-only source files seems to be a perennial ASDF request. The  
> patch below purports to add load-only Common Lisp source files to  
> ASDF. One can create a system file with them either by using the new  
> class "interpreted-cl-source-file" or by using the keyword :load-only- 
> p. For example, both of the files in the below would only be loaded,  
> not compiled:
>
> (asdf:defsystem test5
>    :components
>    ((:module "deps"
> 	    :pathname "."
> 	    :components
> 	    ((:interpreted-cl-source-file "file1")
> 	     (:file "file2" :load-only-p t)))))
>
> If no-one sees any problems with this, I'll commit it soon.

Why have both a class and a slot?  The lack of a writer suggests that
you don't expect the value to change once an instance is created; why
not have just the class?

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:

(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 input-files ((o load-op) (c load-only-cl-source-file))
  (list (component-pathname c)))

I named the class "load-only-cl-source-file" because asdf doesn't
control whether an implementation's LOAD interprets or compiles the
file.  I'm not certain that this implements everything necessary; it
does everything the documentation calls for except for adding method
to EXPLAIN, and does seem to work for a system with two files that
merely print output when compiled and loaded.

I'm all for including features that people find useful in asdf.lisp
itself, however.

Just my two cents,
RmK


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.