From: Pierre THIERRY
Subject: Playing with pathnames
Date: 
Message-ID: <pan.2006.07.16.16.13.31.716539@levallois.eu.org>
Hi,

as I'm playing with pathnames and ASDF, I wonder why the following code:

(setf
  (logical-pathname-translations "xdg-config")
    '(("**;*.*.*" (merge-pathnames ".config/**/" (user-homedir-pathname)))))

triggers the following error:

The value (MERGE-PATHNAMES ".config/**/" (USER-HOMEDIR-PATHNAME))
is not of type
  (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING PATHNAME FILE-STREAM).
   [Condition of type TYPE-ERROR]

Although:

CL-USER> (class-of (merge-pathnames ".config/**/" (user-homedir-pathname)))
#<STRUCTURE-CLASS PATHNAME>

So I'm really confused... (running SBCL 0.9.14)

Erroneously,
Nowhere man
-- 
···········@levallois.eu.org
OpenPGP 0xD9D50D8A
From: Barry Margolin
Subject: Re: Playing with pathnames
Date: 
Message-ID: <barmar-26ABF6.12445416072006@comcast.dca.giganews.com>
In article <······························@levallois.eu.org>,
 Pierre THIERRY <···········@levallois.eu.org> wrote:

> Hi,
> 
> as I'm playing with pathnames and ASDF, I wonder why the following code:
> 
> (setf
>   (logical-pathname-translations "xdg-config")
>     '(("**;*.*.*" (merge-pathnames ".config/**/" (user-homedir-pathname)))))
> 
> triggers the following error:
> 
> The value (MERGE-PATHNAMES ".config/**/" (USER-HOMEDIR-PATHNAME))
> is not of type
>   (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING PATHNAME FILE-STREAM).
>    [Condition of type TYPE-ERROR]

Because the list you provided is quoted, so it never calls the 
MERGE-PATHNAMES function.  Try:

`(("**;*.*.*" ,(merge-pathnames ...)))

> 
> Although:
> 
> CL-USER> (class-of (merge-pathnames ".config/**/" (user-homedir-pathname)))
> #<STRUCTURE-CLASS PATHNAME>

Now you're evaluating the MERGE-PATHNAMES expression.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***