patch for class-for-type
Gary King <[email protected]>
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
I think that class-for-type should be defined as:
(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))))
The current version (1.79) puts the find-class outside of the or. The
problem occurs when symbol-name is defined in both *package* and
#.*package* but it is not a class in *package*. E.g., if the symbol
module is in *package* but not as a class. In this case, I think that
the correct behavior would be to ignore the symbol in *package* and go
on to look at the same symbol in #.*package*.
--
Gary Warren King, Lab Manager
EKSL East, University of Massachusetts * 413 577 0176
To hold people without charge and without access to legal counsel risks
the creation of an 'American gulag' for those detained in the course of
the war on terror.
-- Amnesty International USA