Subject: Re: Logical pathname hosts.
From: Erik Naggum <erik@naggum.no>
Date: 1998/12/21
Newsgroups: comp.lang.lisp
Message-ID: <3123192188393170@naggum.no>

* robert_m_miles@yahoo.com
| How do I take a pathname like:
| /home/rmiles/code/lisp/source/demos/foo.lisp
| 
| and set it up so that I can do stuff like:
| 
| (load "demo:foo.lisp")
| 
| instead of
| 
| (load "/home/rmiles/code/lisp/source/demos/foo.lisp")

(setf (logical-pathname-translations "demo")
  '(("**;*.*"  "/home/rmiles/code/lisp/source/demos/")
    (";**;*.*" "/home/rmiles/code/lisp/source/demos/")))

  this sets up both absolute and relative logical pathnames (in that order)
  on the host DEMO to map to the same directory.

  under Allegro CL, you could also put this into sys:hosts.cl:

"demo"		'(#L"**;*.*"	#P"/home/rmiles/code/lisp/source/demos/")
		'(#L";**;*.*"	#P"/home/rmiles/code/lisp/source/demos/")

  or put it in some other file and register that file as a hosts map:

(push <some-other-file> (logical-pathname-translations-database-pathnames))

  (#L is a pathname syntax that forces the string into a logical pathname.
  it turns out to be a very useful extension to the standard syntax, which
  would use #P in both cases.  not that this wouldn't work in this case.)

  it is generally a good idea to separate the logical hosts setup as much
  as possible from your other code so you won't need to recompile anything
  if you move things around.  after all, that's the purpose of this thing.

#:Erik
-- 
  Nie wieder KrF!  Nie wieder KrF!  Nie wieder KrF!  Nie wieder KrF!