[Ecls-list] enough-namestring

timothy tschaef at sbcglobal.net
Fri Jun 30 03:57:17 UTC 2006


I'm running on Debian, and am trying to adapt the post...install stuff
in a local copy so asdf can compile packages.  When ecl tries to compile
packages, it tries to write the output files in the source directory,
but common-lisp-controller, and I, would like them to go to a
user-specific directory somewhere else.

After playing with :after methods on asdf output-files, I found that the
function to translate the pathname was using enough-namestring.  This
function does not function correctly when the source is in a
subdirectory of the defaults.

> (enough-namestring
> (enough-namestring 

This from the Hyperspec:

enough-namestring returns an abbreviated namestring that is just
sufficient to identify the file named by pathname when considered
relative to the defaults. It is required that
(merge-pathnames (enough-namestring pathname defaults) defaults)
==  (merge-pathnames (parse-namestring pathname nil defaults) defaults)

The condition is met (I checked it) but the second case above does not
seem to do what is described here.  I would expect to get
"iterate/package.fas" in the second case.  

Here's the source(from pathname.d):

@(defun enough_namestring (path
	&o (defaults si_default_pathname_defaults()))
	cl_object newpath;
	defaults = cl_pathname(defaults);
	path = cl_pathname(path);
	= make_pathname(equalp(path->pathname.host,
                        defaults->pathname.host) ?
			Cnil : path->pathname.host,
			       defaults->pathname.device) ?
			Cnil : path->pathname.device,
			       defaults->pathname.directory) ?
			Cnil : path->pathname.directory,
                        defaults->pathname.name) ?
			Cnil : path->pathname.name,
                        defaults->pathname.type) ?
			Cnil : path->pathname.type,
			       defaults->pathname.version) ?
			Cnil : path->pathname.version);
	newpath->pathname.logical = path->pathname.logical;
	@(return ecl_namestring(newpath, 1))

I think everything is ok except the directory matching. I'll try to come
up with a solution and send a patch, unless someone else comes up with
something first.  Is set-difference avialable here? Any suggestions?

Tim Schaeffer

More information about the ecl-devel mailing list