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")
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)
·············@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")
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")
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
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