[asdf-devel] create temporary Lisp files in fasl directory
Robert Goldman
rpgoldman at sift.info
Fri Aug 6 17:02:52 UTC 2010
On 8/6/10 Aug 6 -11:49 AM, Robert Brown wrote:
> On Fri, Aug 6, 2010 at 1:24 AM, Stelian Ionescu <sionescu at cddr.org
> <mailto:sionescu at cddr.org>> wrote:
>
> Try something like this:
>
> (defmethod asdf:perform ((op asdf:compile-op) (c protobuf-source-file))
> (let* ((output-defaults (pathname (car (asdf:output-files op c))))
> (generated-source-file (make-pathname :name (pathname-name
> (asdf:component-pathname c))
> :type "lisp"
> :defaults
> output-defaults)))
> ))
>
> You need to call OUTPUT-FILES which will apply the output
> translations you've configured
This example suggests a possible improvement to the API to avoid
problems down the road.
I'd suggest we add a new exported function, ASDF:OUTPUT-FILE (singular),
which has the same signature as ASDF:OUTPUT-FILES.
ASDF:OUTPUT-FILE should return the first element of the list returned by
ASDF:OUTPUT-FILES, if this list is of length 1. If ASDF:OUTPUT-FILES
returns a list of length != 1, ASDF:OUTPUT-FILE should raise an error.
This is for people who are writing some code that is correct under the
assumption that there will be only a single output-file. I bet a lot of
people call (first (asdf:output-files ...)), effectively just hoping
that no one went around behind their backs and changed the number of
output files.
best,
r
More information about the asdf-devel
mailing list