On 2010-03-30, at 21:36 , Robert Goldman wrote:
On 3/30/10 Mar 30 -1:48 PM, james anderson wrote:
On 2010-03-30, at 20:36 , Juan Jose Garcia-Ripoll wrote:
I think I know roughly what Juanjo means here. In particular:
- I don't like to have my systems use the ASDF API internally.
E.g., I will set up variables with pathnames, or use logical pathnames in my ASDF system definition files, so that my actual code doesn't have to use something like asdf:system-definition-pathname.
- I have worked with people who don't use ASDF. If I observe
strictures like the ones I lay out in point 1, then those people can write a simple load file that somehow initializes the logical pathnames and loads the code (how to do that is /their/ problem!) and then they can use my code just as I do. If I used calls like asdf:system-definition-pathname, that would not be possible.
So I think Juanjo's objectives here (or at least my interpretation of his objectives!) are reasonable.
You got it right. I would extend the argument but I have to leave. Perhaps tomorrow.
? one can do that now. without any changes to asdf and without any purity tests. so, he must be thinking of something in addition.
Can you explain how to do this?
i have found two ways to do this.
a. put logical hosts on asdf's search path and unify the pathnames for found system definitions with them. this is semi-pure in that the mechanism is part of an extension[1] and hooks into an additional method for system instantiation, but, in principle, it has nothing to do with the hierarchal name mechanism. it uses the mappings cited[2] in the earlier message to implement the equivalent of binary locations in terms pathname translation patterns which match the output file type.
b. define a host anew for each system definition[3]. this uses [2] to root a host at a given location. by default that of the currently loaded file.
--- [1] : http://github.com/lisp/de.setf.utility/blob/master/asdf/ hierarchical-names.lisp#L274 (this uses on operator from [2].) [2] : http://github.com/lisp/de.setf.utility/blob/master/ pathnames.lisp#L119 [3] : http://github.com/lisp/de.setf.amqp/blob/master/amqp.asd#L36
I typically have an ugly mess in my .asd files where I get *load-truename*, and then fuss with it to extract the directory pathname, etc. Juanjo's :logical-hostname ASDF extension seems very handy to me. My alternative involves a lot of repeated boilerplate code, and it's surprisingly fussy to extract that directory pathname....
i have managed to get most of the boilerplate out of the system definitions. if you need a system-specific host, there's going to be one form or one argument somewhere. recall the requirement, that the system also build without asdf. if shared one suffices, the unification mechanism requires no extra terms in the definition.