Hi, Faré
I think the "binding ccl::*user-homedir-pathname*" suggestion by Terje was based on "not touching ASDF source code itself". With this approach, people could use
(let ((ccl::*user-homedir-pathname* (ccl::findfolder #$kuserdomain #$kCurrentUserFolderType))) (asdf:load-system ...))
to make ASDF work on MCL.
For your question about why not the conditional be inside the truename, i think it's because MCL's result are already a truename:
? (in-package :asdf) #<Package "ASDF"> ? (ccl::findfolder #$kuserdomain #$kCurrentUserFolderType) #P"Macintosh HD:Users:binghe:" ? (pathname-directory-pathname *) #P"Macintosh HD:Users:binghe:" ? (truenamize *) #P"Macintosh HD:Users:binghe:"
MCL doesn't support UNIX-like pathname (i.e. "/Users/binghe"), so above is just the final truename.
I'm not sure if it's good to consider using a MCL patch to change the return value of (user-homedir-pathname), because Common Lisp standard never say what exactly the "user's home directory" means when the optional host arguments not given [1]. I guess MCL designers may thought that MCL application itself is living in a separate "host", apart from the Macintosh OS (as another host), this is a common approach in old Lisp systems like Symbolics Lisp Machine as I can see.
(when I'm still writing this mail, Terje already showed another viewpoint: the patch may conflict with legacy code)
Any way, as a MCL & ASDF user, I suggest using my previous patch, and I don't disagree following form:
(defun* user-homedir () (truenamize (pathname-directory-pathname #-mcl (user-homedir-pathname) #+mcl (ccl::findfolder #$kuserdomain #$kCurrentUserFolderType))))
Regards,
Chun Tian (binghe)
[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_user_h.htm#user-home...
在 2011-5-19,10:58, Faré 写道:
2011/5/18 Chun Tian (binghe) binghe.lisp@gmail.com:
Great, then why not replace ASDF's function user-homedir into this one:
(defun* user-homedir () #+mcl (ccl::findfolder #$kuserdomain #$kCurrentUserFolderType) #-mcl (truenamize (pathname-directory-pathname (user-homedir-pathname))))
I've made a patch (in attach), include above new definition and some notes. I hope Faré could merge it.
I'd do it, except the page you cite in your message suggests setting the binding for ccl::*user-homedir-pathname* instead. Shouldn't we do that instead? Or does any code rely on that file being the MCL path? Is the MCL path saved anywhere else? Note that user-homedir usually returns a truename, which translations depend upon to work properly. If you're hacking user-homedir instead of the global variable, shouldn't the conditional be inside the truename? http://code.google.com/p/mcl/wiki/Portability
Since you seem to be the one main user of MCL and ASDF, why don't you decide what it should be in the end? I'll release a 2.015.4 for you after you've made your mind.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Speed has always been important otherwise one wouldn't need the computer. —Seymour Cray