Suggested change to ASDF class-for-type

Gary King <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
I'd like to propose the change below for ASDF's class-for-type. The 
current implementation (also included below) will break if *package* 
contains the symbol 'module. The new version will only break if it 
contains the class 'module -- the former is more likely than the later.

(defun class-for-type (parent type)
   (let ((class (or (find-class (find-symbol (symbol-name type) 
*package*) nil)
                    (find-class (find-symbol (symbol-name type) 
#.*package*) nil))))
     (or class
	(and (eq type :file)
	     (or (module-default-component-class parent)
		 (find-class 'cl-source-file)))
         (and (eq type :files)
	     (find-class 'cl-source-files))
	(sysdef-error (formatter "~@<don't recognize component type ~A~@:>")
		      type))))

#+Old
(defun class-for-type (parent type)
   (let ((class (find-class
		(or (find-symbol (symbol-name type) *package*)
		    (find-symbol (symbol-name type) #.*package*)) nil)))
     (or class
	(and (eq type :file)
	     (or (module-default-component-class parent)
		 (find-class 'cl-source-file)))
         (and (eq type :files)
	     (find-class 'cl-source-files))
	(sysdef-error (formatter "~@<don't recognize component type ~A~@:>")
		      type))))
-- 
Gary Warren King, Lab Manager
EKSL East, University of Massachusetts * 413 577 0176

There is no self, if by self we mean some central cognitive essence 
that makes me who and what I am. In its place there is just the “soft 
self”: a rough and tumble, control sharing coalition of proceses--some 
neural, some bodily, some technologica--and an ongoing drive to tell a 
story, to pain a picture in which “I” an the central player.
-- Andy Clark, Natural Born Cyborgs


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
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.