Subject: [clisp-list] make-pathname question

From: [email-masked]
Date: Fri Jul 30 16:18:01 2004

I don't understand this behavior: 

(setf *cust-name* "TOT")
(setf *cust-root* (pathname "c:/"))
(setf *cust-home-dir
 (merge-pathnames (make-pathname :directory '(:relative *cust-name*))
                   *cust-root*)) 

*** - MAKE-PATHNAME: illegal :DIRECTORY argument (:RELATIVE *CUST-NAME*) 

however 

(setf *cust-home-dir
 (merge-pathnames (make-pathname :directory '(:relative "TOT")) 
*cust-root*)) 

#P"/cygdrive/c/TOT/" 

The only difference (as far as I can tell) is the use of the literal string 
in the directory list (that works) and the variable (which doesn't). 

Is this a bug that should be reported, or am I doing something wrong? 

GNU CLISP 2.33.2 (2004-06-02) (built 3299436836) (memory 3299437271)
Software: GNU C 3.3.1 (cygming special) ANSI C program
Features:
(SYSCALLS REGEXP POSTGRESQL BERKELEY-DB CLOS LOOP COMPILER CLISP ANSI-CL
COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES
SCREEN FFI GETTEXT UNICODE BASE-CHAR=CHARACTER UNIX CYGWIN)
Installation directory: /usr/local/lib/clisp/
User language: ENGLISH
Machine: I686 (I686) DUSU3500B31.us.ad.hertz.com [10.0.148.76] 

(source compiled from distribution on sf.net -- not cvs since I can't get 
cvs from behind the company firewall) 

Thanks,
Jeff

---

From: Pascal J.Bourguignon <[email-masked]>
Date: Fri Jul 30 19:32:06 2004

> Is this a bug that should be reported, or am I doing something wrong? 

You are doing something wrong.  MAKE-PATHNAME wants strings, not
symbols, or "variables" as you name it.

Why don't you give it what it wants?

(setf *cust-home-dir
  (merge-pathnames (make-pathname :directory (list :relative *cust-name*))
                    *cust-root*))

or:

(setf *cust-home-dir
  (merge-pathnames (make-pathname :directory `(:relative ,*cust-name*))
                    *cust-root*))

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein