From: Doug Tolton
Subject: make-pathname problems
Date: 
Message-ID: <A3elb.252382$Pk.40053@news.easynews.com>
I'm getting and error with this function call:

(defun get-batch (batch-name)
   (setf *batch* (make-pathname :host "PROC"
                                :directory '(:absolute "WORK" "BATCHES" 
batch-name)
                                :name batch-name :type "IMG")))


here is the response I get:
CL-USER 10 > (get-batch "X002004")

Error: Directory component BATCH-NAME must be a string or one of (:WILD 
:WILD-INFERIORS :BACK :UP).
   1 (abort) Return to level 0.
   2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other 
options

I want to  just pass in a fragment of the directory and have it return 
the fully qualified path to me.  What am I missing with this?

-- 
Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")

From: ·············@comcast.net
Subject: Re: make-pathname problems
Date: 
Message-ID: <7k2y4hod.fsf@comcast.net>
Doug Tolton <····@nospam.com> writes:

> I'm getting and error with this function call:
>
> (defun get-batch (batch-name)
>    (setf *batch* (make-pathname :host "PROC"
>                                 :directory '(:absolute "WORK"
>                                 "BATCHES" batch-name)
>                                 :name batch-name :type "IMG")))
>
>
> here is the response I get:
> CL-USER 10 > (get-batch "X002004")
>
> Error: Directory component BATCH-NAME must be a string or one of
> (:WILD :WILD-INFERIORS :BACK :UP).
>    1 (abort) Return to level 0.
>    2 Return to top loop level 0.
>
> Type :b for backtrace, :c <option number> to proceed,  or :? for other
> options
>
> I want to  just pass in a fragment of the directory and have it return
> the fully qualified path to me.  What am I missing with this?

`(:absolute "WORK" "BATCHES" ,batch-name)
From: Doug Tolton
Subject: Re: make-pathname problems
Date: 
Message-ID: <pielb.3366271$Bf5.462391@news.easynews.com>
·············@comcast.net wrote:

> Doug Tolton <····@nospam.com> writes:
> 
> 
>>I'm getting and error with this function call:
>>
>>(defun get-batch (batch-name)
>>   (setf *batch* (make-pathname :host "PROC"
>>                                :directory '(:absolute "WORK"
>>                                "BATCHES" batch-name)
>>                                :name batch-name :type "IMG")))
>>
>>
>>here is the response I get:
>>CL-USER 10 > (get-batch "X002004")
>>
>>Error: Directory component BATCH-NAME must be a string or one of
>>(:WILD :WILD-INFERIORS :BACK :UP).
>>   1 (abort) Return to level 0.
>>   2 Return to top loop level 0.
>>
>>Type :b for backtrace, :c <option number> to proceed,  or :? for other
>>options
>>
>>I want to  just pass in a fragment of the directory and have it return
>>the fully qualified path to me.  What am I missing with this?
> 
> 
> `(:absolute "WORK" "BATCHES" ,batch-name)
Yep, that fixed it, thanks.

-- 
Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: james anderson
Subject: Re: make-pathname problems
Date: 
Message-ID: <3F956FDE.6F3642FD@setf.de>
Doug Tolton wrote:
> 
> I'm getting and error with this function call:
> 
> (defun get-batch (batch-name)
>    (setf *batch* (make-pathname :host "PROC"
>                                 :directory '(:absolute "WORK" "BATCHES"
> batch-name)
>                                 :name batch-name :type "IMG")))

?

                                  :directory `(:absolute "WORK" "BATCHES" ,batch-name)

> 
> here is the response I get:
> CL-USER 10 > (get-batch "X002004")
> 
> Error: Directory component BATCH-NAME must be a string or one of (:WILD
> :WILD-INFERIORS :BACK :UP).
>    1 (abort) Return to level 0.
>    2 Return to top loop level 0.
> 
> Type :b for backtrace, :c <option number> to proceed,  or :? for other
> options
> 
> I want to  just pass in a fragment of the directory and have it return
> the fully qualified path to me.  What am I missing with this?
> 
> --
> Doug Tolton
> (format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: Kenny Tilton
Subject: Re: make-pathname problems
Date: 
Message-ID: <sSQlb.28645$pT1.11747@twister.nyc.rr.com>
james anderson wrote:
> 
> Doug Tolton wrote:
> 
>>I'm getting and error with this function call:
>>
>>(defun get-batch (batch-name)
>>   (setf *batch* (make-pathname :host "PROC"
>>                                :directory '(:absolute "WORK" "BATCHES"
>>batch-name)

Don't forget what QUOTE does. In the case, you are sending make-pathname 
a list which ends with the symbol batch-name, as if you had coded:

    (list :absolute "work" "batches" 'batch-name)

You can either:

    (list :absolute "work" "batches" batch-name)


...or:

     `(:absolute "work" "batches" ,batch-name)

kenny

-- 
http://tilton-technology.com
What?! You are a newbie and you haven't answered my:
  http://alu.cliki.net/The%20Road%20to%20Lisp%20Survey
From: Marco Antoniotti
Subject: Re: make-pathname problems
Date: 
Message-ID: <QXjlb.47$KR3.14069@typhoon.nyu.edu>
Doug Tolton wrote:

> I'm getting and error with this function call:
> 
> (defun get-batch (batch-name)
>   (setf *batch* (make-pathname :host "PROC"
>                                :directory '(:absolute "WORK" "BATCHES" 
> batch-name)

Try the following

	cl-prompt> '(:absolute "WORK" "BATCHES" batch-name)

and

	cl-prompt> (list :absolute "WORK" "BATCHES" batch-name)

you will see that this is not a pathname problem at all.


Cheers
--
Marco