:around-compile - wonderful solve of problem! Can add the :around-load for similar purpose? This it seems logical.
Втр 18 Окт 2011 09:44:17 +0400, Far fahree@gmail.com написал:
I don't see how can you manipulate things by defining subclasses of cl-source-file.
(defpackage :my-system-system (:use :asdf :cl))
(in-package :my-system-system)
(defclass my-cl-source-file (cl-source-file) ())
(defmethod perform ((op compile-op) (c my-cl-source-file)) ...) ;; wrapping!
(defsystem :my-system :default-component-class my-cl-source-file :components ((cl-source-file "package") ;; override the new default, so this one isn't wrapped! (:file "macros" :depends-on ("package")) ...))
I have to admit that I don't understand how components are created in asdf. My best guess (by looking at the class-for-type function) is that everything defined in the defsystem by :file and having .lisp extension becomes *default-component-class* which is cl-source-file.
Yup. ASDF is really straightforward. Especially after all the refactoring we did for ASDF 2, for the only way we managed to make sense of the code we inherited was to simplify it. See also the article Robert and I wrote on ASDF: http://common-lisp.net/project/asdf/ilc2010draft.pdf
And I neither want to introduce a new syntax next to :file, nor change my lisp file extensions to something else. So I don't see how your components can become subclasses of cl-source-file at all.
Doing it with the new :around-compile feature, it would be:
(defun my-package-frob-hook (thunk) (call-with-package-renamings '((long-name-1 shrtnm1) (long-name-2 shrtnm2)) (funcall thunk)))
(defsystem :my-system :depends-on ((:version :asdf "2.017.18")) :around-compile my-package-frob-hook :components ((:file "package" :around-compile nil) ;; no frobbing around this one (:file "macros" :depends-on ("package")) ...))
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The reason why we must be tolerant is NOT that everyone is as right as everyone else. It is that no system allows to reliably distinguish right and wrong beforehand. Only by having the right to err can one have the right to be correct. The attitude of toleration is thus to let the fools be victims of their own folly rather than of ours, as long as they in turn do not impose their folly upon us. — Faré
asdf-devel mailing list asdf-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel