I have a question about ASDF. What is the best way to specify
modules? I was thinking I could just do something like this:
(asdf:defsystem foo-system
:serial t
:components
((:module "dep-a")
(:module "dep-b")))
and it would know to perform the current operation recursively on the
modules (which have their own asd files). However, the above does
nothing.
So I wound up doing something like this, which I think is messier:
(pushnew (make-pathname
:directory
(append (pathname-directory *load-truename*) (list "dep-a")))
asdf:*central-registry*)
(pushnew (make-pathname
:directory
(append (pathname-directory *load-truename*) (list "dep-b")))
asdf:*central-registry*)
(asdf:defsystem foo-system
:serial t
:depends-on ("dep-b"))
Then in the "dep-b" directory there is dep-b.asd
(asdf:defsystem dep-b
:serial t
:depends-on ("dep-a")
:components
((:file "file1")
(:file "file2")
(:file "file3")
(:file "file4")))
And of course in the "dep-a" directory there is dep-a.asd which contains
(asdf:defsystem dep-a
:serial t
:components
((:file "file1")
(:file "file2")))
The goal is to try to keep each subsystem contained in its own
directory.
Is there a better way to do this?
--
Jordan Hubbard: We have a crash bug. It needs to be fixed. We DO NOT
need to know how to print 3000 spaces in 11 different languages! :-)
Daniel Sobral: I concur. But if anyone wants to do it with loader,
: 3kbl 3000 0 do bl emit loop ; 3kbl will do the trick.
Just to clarify. When I was using the
(asdf:defsystem foo-system
:serial t
:components
((:module "dep-a")
(:module "dep-b")))
version of the foo-system.asd file, I had a dep-a.asd and a dep-b.asd
file in the respective lower level directories. Then when I typed
(load "foo-system.asd")
(asdf:oos 'asdf:load-op :foo-system)
it just returned nil without doing anything.
--
Fred Gilham ······@csl.sri.com
The amazing thing is, back when I was a C++ programmer, I thought that
[Design Patterns] was SUCH a great book. And I guess it was, in a
way: it made it possible to use C++ and get something done. In the
long run, of course, that may have been a disservice... - Alain Picard
Fred Gilham <······@snapdragon.csl.sri.com> writes:
> I have a question about ASDF. What is the best way to specify
> modules? I was thinking I could just do something like this:
>
> (asdf:defsystem foo-system
> :serial t
> :components
> ((:module "dep-a")
> (:module "dep-b")))
>
>
> and it would know to perform the current operation recursively on the
> modules (which have their own asd files). However, the above does
> nothing.
Yep. The built-in ASDF:MODULE class lets you specify a list of
components in a sub-directory. Eg,
(:module "dep-a" :components ((:file "defpackage")
(:file "utils" :depends-on ("defpackage"))
...))
However, you're not limited to the built-in component classes. What I
would do is write a SUBSYSTEM class that looks in the subdirectory for
an asdf system and performs the current operation on it.
> However, you're not limited to the built-in component classes. What
> I would do is write a SUBSYSTEM class that looks in the subdirectory
> for an asdf system and performs the current operation on it.
Thanks. I'll take a look at doing that.
--
Fred Gilham ······@csl.sri.com
When trying to reach the lowest common denominator, you have to be
prepared for the occasional division by zero.
Thomas F. Burdick wrote:
> Fred Gilham <······@snapdragon.csl.sri.com> writes:
>
>
>>I have a question about ASDF. What is the best way to specify
>>modules? I was thinking I could just do something like this:
>>
>>(asdf:defsystem foo-system
>> :serial t
>> :components
>> ((:module "dep-a")
>> (:module "dep-b")))
>>
>>
>>and it would know to perform the current operation recursively on the
>>modules (which have their own asd files). However, the above does
>>nothing.
>
>
> Yep. The built-in ASDF:MODULE class lets you specify a list of
> components in a sub-directory. Eg,
>
> (:module "dep-a" :components ((:file "defpackage")
> (:file "utils" :depends-on ("defpackage"))
> ...))
>
> However, you're not limited to the built-in component classes. What I
> would do is write a SUBSYSTEM class that looks in the subdirectory for
> an asdf system and performs the current operation on it.
MK:DEFSYSTEM does that automatically when you specify a :SYSTEM component.
(mk:defsystem foo-system
:components ((:system "dep-a")
(:system "dep-b")))
Note that this is in alternative to
(mk:defsystem foo-system
:depends-on ("dep-a" "dep-b"))
Both versions have their uses.
Cheers
--
Marco