Re: Logical Pathnames - Looking for advice
On Jan 30, 2013, at 18:46 , Camille Troillard <camille@osculator.net> wrote:
>
> Hello,
>
> I find useful the possibility to abstract out a specific location using logical pathnames. I can use the same pathname, for example, to refer to the directory where I store dynamic libraries. Wether the application runs in the LW IDE or is deployed on OS X or Windows, my code still use the same pathnames.
>
> Now, I am not familiar with how all this works, or has historically worked on Lisp machines, but I can see the LW library directory contains a "translations" directory in which there is a single translation at the moment for the Editor sources:
>
> (setf (logical-pathname-translations "EDITOR-SRC")
> `(("*" ,(merge-pathnames
> (make-pathname :name :wild :directory '(:relative "src" "editor"))
> (sys:lisp-library-directory)))))
>
>
> While this makes sense for site-wide configuration, it does not seem to apply for delivered products.
>
> So, here's my question: If you use or were using logical pathname translations, where is the best place to put the configuration code (such as the one above) for development and delivery? What's your approach?
>
> I'd like to know if there are best practices regarding this question, and trying not reinvent the wheel.
I'm not sure that I understand your question, so the following may not be the answer you're looking for... it's also possibly not best practice.
If I wanted to set up logical pathname translations for delivered products, I'd use (lw:current-pathname) to get the pathname for the delivered executable, and possibly (hcl:delivered-image-p) to distinguish between settings appropriate in the development environment and settings for the delivered product.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html