Land Of Lisp chapter 7 - Using SBCL
blog.ciaranbradley.com
Land Of Lisp chapter 7 - Using SBCL
1–10 of 15 posts
Re: Land Of Lisp chapter 7 - Using SBCL
#2disclaimer: I'm a LISP noob, so this is a beginners hack, but it may help others (like me) who have had difficulty installing CLISP.
Re: Land Of Lisp chapter 7 - Using SBCL
#3Re: Land Of Lisp chapter 7 - Using SBCL
#4Instead of using implementation dependent functions, use a library like trivial-shell, which is also available via QuickLisp. It has the SHELL-COMMAND function you need. http://common-lisp.net/project/trivial-shell/
Re: Land Of Lisp chapter 7 - Using SBCL
#5Instead of using implementation dependent functions, use a library like trivial-shell, which is also available via QuickLisp. It has the SHELL-COMMAND function you need. http://common-lisp.net/project/trivial-shell/
(defun str (&rest strings)
(apply 'concatenate 'string
(loop for x in strings
collecting (format nil "~a" x))))
You can use it like this: (shell (str "dot -Tpng -O " fname))
You might also find that WITH-OPEN-FILE arguments can get a little unwieldy to type in the repl, specially if you want to overwrite files, so you can use this WITH-TEXT-FILE macro. For binary files you will just need to add (:element-type '(unsigned-byte 8)) (defmacro with-text-file ((stream path) &body body)
`(with-open-file (,stream ,path
:direction :io
:if-exists :supersede
:if-does-not-exist :create)
,@body))Re: Land Of Lisp chapter 7 - Using SBCL
#6Instead of using implementation dependent functions, use a library like trivial-shell, which is also available via QuickLisp. It has the SHELL-COMMAND function you need. http://common-lisp.net/project/trivial-shell/
Cheers, I thought there might be something that was QL installable but didn't want to get sidetracked from the task at hand. I'll have a play with that in the morning :)
Of course, you're more than welcome to shoot me an email if you ever get stuck.
Here is a far more forgiving reference to Common Lisp than the Hyperspec, though don't let the fancy TeX typesetting intimidate you.
http://clqr.berlios.de/clqr-a4-consec.pdf
In addition to that, I think you should dump yourself a nice image with ASDF and QL builtin, so you don't have to load them every time.
Re: Land Of Lisp chapter 7 - Using SBCL
#7Re: Land Of Lisp chapter 7 - Using SBCL
#8A page dedicated to landoflisp on sbcl would great. clisp looks like more trouble to install on my mac than the sbcl package.
Re: Land Of Lisp chapter 7 - Using SBCL
#9A page dedicated to landoflisp on sbcl would great. clisp looks like more trouble to install on my mac than the sbcl package.
Re: Land Of Lisp chapter 7 - Using SBCL
#10Instead of using implementation dependent functions, use a library like trivial-shell, which is also available via QuickLisp. It has the SHELL-COMMAND function you need. http://common-lisp.net/project/trivial-shell/
Also, you might find this slow little utility for converting a bunch of stuff into strings. It will do the job nicely, and it accepts every Lisp type. (defun str (&rest strings) (apply 'concatenate 'string (loop for x in strings collecting (format nil "~a" x)))) You can use it like this: (shell (str "dot -Tpng -O " fname)) You might also find that WITH-OPEN-FILE arguments can get a little unwieldy to type in the repl…
(defun str (&rest strings)
(format nil "~{~A~}" strings))