On 3/29/10 11:33 AM, Mark Evenson wrote: […]
I'd favor either a keyword argument or :function as a magic marker to be inserted in FIRST position, followed by a function designator (and additionally, parameters to curry?). Unless of course, you symmetrically accept a FUNCTION in first position to denote a "recognize if this matching rule applies".
I would think that we want to preserve the current ability for the user to vistually scan down the list of translations to determine what should match, so I would favor going for your second proposal. It doesn't make sense that there be a match predicate paired with a translation pathname right? So the two new possibilities for output translation lists would be:
("/**/foo/*.*" (:function FOO-OUTPUT-TRANSLATION)) ((:function BAR-PATHNAME-P) (:function BAR-OUTPUT-TRANSLATION))
Attached is a patch against ASDF that allows a user specified function to take the place of TRANSLATE-PATHNAME as the ASDF2 output translation function.
Additionally it adds an ABCL specific extension to ASDF2 that uses this ability by providing the following translations by default
(#p"jar:file:/**/*.jar!/**/*.*" (:function translate-jar-pathname)) (#p"/:jar:file/**/*.*" (:user-cache #p"**/*.*")))
that will map all ASDF loads from jar pathnames to an output location under the per user cache location. This will allow the loading of ASDF systems packaged in jar files which first compiles and then loads FASLs to the local filesystem.
To run this with ABCL you will need to build a custom build of ABCL with the attached patch which is currently necessary to OPEN a jar pathname. This patch is part of a large set of modifications that allow ABCL to open a pathname specified as a url, that I am developing and testing as a unit. These modiictions will be placed in ABCL trunk soon, but first I need to add create more unit tests for the introduced functionality and implement a few more suggestions (like URI encoding functions).
I did not implement Faré's suggestion of including a syntax for a predicate function as the first argument for a output translation pair, because I couldn't come up with a use case in which the current default function PATHNAME-MATCH-P would not work. If someone can come up with such a case, or this deficiency prevents ASDF from accepting this patch, I can have a go at it again.