Next: How can I produce a binary at a specific path from sources at a specific path?, Previous: How can I capture ASDF’s output?, Up: Issues with using and extending ASDF to define systems [Contents][Index]
Conventional Common Lisp code may use *LOAD-TRUENAME*
or *LOAD-PATHNAME*
to find
files adjacent to source files. This will generally not work in
ASDF-loaded systems. Recall that ASDF relocates the FASL files it
builds, typically to a special cache directory. Thus the value of
*LOAD-PATHNAME*
and *LOAD-TRUENAME*
at load time, when ASDF is loading your system,
will typically be a pathname in that cache directory, and useless to you
for finding other system components.
There are two ways to work around this problem:
system-relative-pathname
function. This can readily be
used from outside the system, but it is probably not good software
engineering to require a source file of a system to know what
system it is going to be part of. Contained objects should not have to
know their containers.
(or *compile-file-pathname* *load-truename*)
(or *LOAD-PATHNAME*
, if you prefer)
in a macro expansion or other compile-time evaluated context.