Prev: land of lisp
Next: Iterate and count
From: Thomas A. Russ on 18 May 2010 12:42 "Haris Bogdanovi��" <fbogdanovic(a)xnet.hr> writes: > I'm trying to install packages like this: > > (require 'asdf) > > (let 'packs '(md5 CL-BASE64 RFC2388 CL-FAD trivial-backtrace usocket > Bordeaux-Threads CL+SSL FLEXI-STREAMS Chunga CL-PPCRE CL-WHO Drakma > hunchentoot) > (dolist (item packs) > (progn > (push (make-pathname :device "c" :directory '(:absolute "lisp" "sbcl" > "site" (symbol-string item))) asdf:*central-registry*) > (asdf:oos 'asdf:load-op item)))) > > But it doesn't work ? Of course not. Let's reformat things a bit into a more standard lisp formatting style for what you have written. Maybe things will be clearer then: (let (QUOTE packs) '(md5 CL-BASE64 RFC2388 CL-FAD trivial-backtrace usocket Bordeaux-Threads CL+SSL FLEXI-STREAMS Chunga CL-PPCRE CL-WHO Drakma hunchentoot) ;; Consider putting a print statement here to show you what ;; the value of PACKS is. (dolist (item packs) (push (make-pathname :device "c" :directory '(:absolute "lisp" "sbcl" "site" (symbol-string item))) asdf:*central-registry*) (asdf:oos 'asdf:load-op item))) I will note that you also don't need a PROGN inside the DOLIST because DOLIST already takes multiple forms in its body. So, does this help you understand what is happening? If not, consider the following: (let (a b) (format t "A=~S~%B=~S~%" a b)) (let ((a) (b)) (format t "A=~S~%B=~S~%" a b)) (let ((a 3) (b '(a b c))) (format t "A=~S~%B=~S~%" a b)) -- Thomas A. Russ, USC/Information Sciences Institute (let ((quote 3)) (format t "QUOTE=~S~%" quote))
From: Thomas A. Russ on 18 May 2010 14:41 "Haris Bogdanovi��" <fbogdanovic(a)xnet.hr> writes: > > (SYMBOL-STRING ITEM) is not allowed as a directory component > > Sorry, I typed that wrong: > > (symbol-name item) or > (string item) > both give me the error: > > (SYMBOL-NAME ITEM) is not allowed as a directory component or > (STRING ITEM) is not allowed as a directory component > > Why when both expressions return string which obviouslly can be a part of > directory name ? The initial problem and your current one suggest that you need to review some of the basic concepts in Common Lisp. The prime one that is giving you trouble here is the concept of evaluation. You need to understand the evaluation model for arguments and the effects of quoting on evaluation. For starters, consider the differences in the following forms. Before trying them out, try to predict what will happen when you give them to the Read-Eval-Print-Loop: (+ 2 3) '(+ 2 3) (list 1 2 3) '(1 2 3) (list 1 2 (+ 1 2) 4) '(1 2 (+ 1 2) 4) Also, in relation to your original issue, you do realize that using symbols will cause case conversions from what you are writing. (At least it will with the default Common Lisp read case of :UPCASE). Now, that might not matter when dealing with Windows, which has a case-insensitive file system, but you could get into trouble in other areas where the case of the filenames matter. It certainly does in Linux, and it may or may not matter under the MacOS -- the default is to not matter. -- Thomas A. Russ, USC/Information Sciences Institute
From: Haris Bogdanovic on 18 May 2010 15:11 Thanks, it works now. I know about the backquote and a comma but it didnt occured to me that I should use them. I finally installed hunchentoot but problems again When trying to start hunchentoot with: (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242)) it complains about usocket "The function USOCKET::%SETUP-WAIT-LIST is undefined" but I guess I better make a new post. :
From: Captain Obvious on 18 May 2010 15:28
HB> I know about the backquote and a comma but HB> it didnt occured to me that I should use them. HB> I finally installed hunchentoot but problems again HB> When trying to start hunchentoot with: HB> (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242)) HB> it complains about usocket HB> "The function USOCKET::%SETUP-WAIT-LIST is undefined" I guess usocket version you're using is not what hunchentoot wants. |