[Openmcl-devel] windows host definition

james anderson james.anderson at setf.de
Tue Apr 6 03:54:11 PDT 2010


On 2010-04-06, at 02:32 , Gary Byers wrote:

> If I understand correctly, you want to do (and -should- be able to  
> do):
>
> (setf (logical-pathname-translations "mac-home")
>       '((#p"**;*.*" #p"v:/**/*.*")))
>
> which is approximately equivalent to the first example in the  
> dictionary
> entry for LOGICAL-PATHNAME-TRANSLATIONS.
>
> If I understand correctly and am not hallucinating, there's been a bug
> in code called by TRANSLATE-LOGICAL-PATHNAME that prevents that from
> working: a pathname such as "mac-home:file.lisp" will fail to match
> the left-hand-side of that rule, because the missing host component  
> in the
> rule (which should be treated as :WILD) will fail to match the  
> pathname's
> host.

the original example contains a relative directory indicator in the  
to wildcard. this causes the attempt to retranslate the initial  
translation to subsequently fail. if the initial ';' is removed from  
the target, a translation succeeds.

the formulation as a logical pathname namestring without a host does  
work. it should be treated as were the host that for which the  
translations are being defined.[1] that abbreviation is exactly to  
permit that the host has not yet been defined. in addition, it should  
be possible to specify the host itself. while implementation are not  
consistent in their initial treatment of a namestring as a from  
wildcard, given a namestring, they do eventually match against the  
intended wildcard logical pathname.

it is possible to bootstrap the definition with a trivial translation  
in order to support circular references, but it is not portable to  
specify other than the respective logical host in a from wildcard  
namestring. and it is not portable to construct a pathname with a not- 
yet-defined intended host. given the suggested workaround, clozure  
creates a logical pathname for the as-yes undefined host. that is non- 
conformant. some implementations similarly lenient, in that they  
construct a non-logical pathname and permit its use. others  
implementations are strict and fail the make-pathname.

>
> You unfortunately can't say:
>
> (setf (logical-pathname-translations "mac-home")
>       '((#p"mac-home:**;*.*" #p"v:/**/*.*")))
>
> because the host part of the namestring in the LHS hasn't been defined
> yet (see 19.3.1.1.1).

you may or may not be able to say it, but the consequences are not  
portable and are not likely to be those intended.
you should be able to say either

   (setf (logical-pathname-translations "mac-home")
         '(("mac-home:**;*.*" #p"v:/**/*.*")))

or

   (setf (logical-pathname-translations "mac-home")
         '(("**;*.*" #p"v:/**/*.*")))

>
> Luckily, you -can- forward-reference the host being defined by using
> MAKE-PATHNAME, as in:
>
> (setf (logical-pathname-translations "mac-home")
>   `((,(make-pathname :host "mac-home"
>                      :directory '(:absolute :wild-inferiors)
>                      :name :wild
>                      :type :wild
>                      :version :wild)
>      #p"v:/**/*.*")))

this technique is not portable as the make-pathname should not  
produce a logical pathname for the from-wildcard.

>
>
> On Sat, 27 Mar 2010, Alexander Repenning wrote:
>
>> I am convinced this has some trivial answer.
>> In parallels running on a Mac I have created a shared home folder  
>> showing up
>> as V: drive in Windows/Parallel on the same machine. So far so good.
>> Now I like to use logical pathnames and define a "mac-home" host  
>> but how?
>> I canot use an existing windows host to define that new host, e.g.,
>> (setf (logical-pathname-translations "mac-home")
>>       '(("**;*.*" "home:;**;")))
>> If I use something like "v:\\...." things do not work either. Using
>> (make-pathname :device "v" .... ) may be getting closer but still  
>> no dice.
>> Any suggestions? This can't be really hard.

---
[1] : http://www.lispworks.com/documentation/HyperSpec/Body/f_logica.htm



More information about the Openmcl-devel mailing list