[asdf-devel] compile-with-nicknames
Gábor Balázs
gabalz at gmail.com
Wed Oct 19 04:14:33 UTC 2011
Sorry for the duplicate. I set the function definitions to defun*, whatever
it means. :)
Plus I changed the name to call-with-package-nicknames as it never renames
any package, just set extra nicknames.
I think it is a better name, you can choose...
`bg`
2011/10/18 Gábor Balázs <gabalz at gmail.com>
>
> Here is the implementation for call-with-package-renamings (see
> attachment).
> I also attached its test case. I successfully tested this on ccl, scl and
> clisp.
> The run-tests.sh script didn't work for me with sbcl (conflicted with my
> system settings), so I skipped that...
>
> Best,
> `bg`
>
>
>
> 2011/10/17 Faré <fahree at 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é
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20111018/1510c397/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asdf-package-nicknames.zip
Type: application/zip
Size: 2462 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20111018/1510c397/attachment.zip>
More information about the asdf-devel
mailing list