<br>Here is the implementation for <span style="font-family: courier new,monospace;">call-with-package-renamings</span> (see attachment).<br>I also attached its test case. I successfully tested this on ccl, scl and clisp.<br>
The run-tests.sh script didn't work for me with sbcl (conflicted with my system settings), so I skipped that...<br><br>Best,<br>`bg`<br><br><br><div class="gmail_quote">2011/10/17 Faré <span dir="ltr"><<a href="mailto:fahree@gmail.com">fahree@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">> I don't see how can you manipulate things by defining subclasses of<br>
> cl-source-file.<br>
<br>
</div>(defpackage :my-system-system<br>
(:use :asdf :cl))<br>
<br>
(in-package :my-system-system)<br>
<br>
(defclass my-cl-source-file (cl-source-file) ())<br>
<br>
(defmethod perform ((op compile-op) (c my-cl-source-file))<br>
...) ;; wrapping!<br>
<br>
(defsystem :my-system<br>
:default-component-class my-cl-source-file<br>
:components<br>
((cl-source-file "package") ;; override the new default, so this one<br>
isn't wrapped!<br>
(:file "macros" :depends-on ("package"))<br>
...))<br>
<div class="im"><br>
> I have to admit that I don't understand how components are created in asdf.<br>
> My best guess (by looking at the class-for-type function) is that everything<br>
> defined in the defsystem by :file and having .lisp extension becomes<br>
> *default-component-class* which is cl-source-file.<br>
><br>
</div>Yup. ASDF is really straightforward. Especially after all the<br>
refactoring we did for ASDF 2,<br>
for the only way we managed to make sense of the code we inherited was<br>
to simplify it.<br>
See also the article Robert and I wrote on ASDF:<br>
<a href="http://common-lisp.net/project/asdf/ilc2010draft.pdf" target="_blank">http://common-lisp.net/project/asdf/ilc2010draft.pdf</a><br>
<div class="im"><br>
> And I neither want to introduce a new syntax next to :file, nor change my<br>
> lisp file extensions to something else.<br>
> So I don't see how your components can become subclasses of cl-source-file<br>
> at all.<br>
><br>
<br>
</div>Doing it with the new :around-compile feature, it would be:<br>
<br>
(defun my-package-frob-hook (thunk)<br>
(call-with-package-renamings<br>
'((long-name-1 shrtnm1)<br>
(long-name-2 shrtnm2))<br>
(funcall thunk)))<br>
<br>
(defsystem :my-system<br>
<div class="im"> :depends-on ((:version :asdf "2.017.18"))<br>
</div> :around-compile my-package-frob-hook<br>
:components<br>
((:file "package" :around-compile nil) ;; no frobbing around this one<br>
(:file "macros" :depends-on ("package"))<br>
...))<br>
<div class="im"><br>
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• <a href="http://fare.tunes.org" target="_blank">http://fare.tunes.org</a><br>
</div>The reason why we must be tolerant is NOT that everyone is as right as<br>
everyone else. It is that no system allows to reliably distinguish right<br>
and wrong beforehand. Only by having the right to err can one have the<br>
right to be correct. The attitude of toleration is thus to let the fools be<br>
victims of their own folly rather than of ours, as long as they in turn<br>
do not impose their folly upon us.<br>
<font color="#888888"> — Faré<br>
</font></blockquote></div><br>