(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)) (defun str (&rest strings)
(format nil "~{~A~}" strings))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.
(defun make-svg (file-name &key jpg)
#+lispworks (sys:call-system-showing-output
(string+ cl-user::*organontech-graphviz* (if jpg " -Tjpg " " -Tsvg ")
cl-user::*fcgaa-lean-mapping-path*
"/" file-name ".dot"
" -o "
cl-user::*fcgaa-lean-mapping-path*
"/" file-name (if jpg ".jpg" ".svg")))
#+sbcl (sb-ext:run-program cl-user::*organontech-graphviz*
(list (if jpg "-Tjpg" "-Tsvg")
(string+ cl-user::*fcgaa-lean-mapping-path* "/" file-name ".dot")
"-o"
(string+ cl-user::*fcgaa-lean-mapping-path* "/" file-name (if jpg ".jpg" ".svg")))
:output (weblog-stream)
)
)
(defun weblog-stream () (or (net.aserve:vhost-log-stream (net.aserve:wserver-default-vhost net.aserve:*wserver*))
t)) ;;sends output directly to html stream on portable allegroserve
(defmacro string+ (string &rest strings)
`(concatenate 'string ,string ,@strings))disclaimer: I'm a LISP noob, so this is a beginners hack, but it may help others (like me) who have had difficulty installing CLISP.
#+sbcl
(defun shell (x)
(run-program "/bin/sh" (list "-c" x) :output t))
Tell me if you want it to work in an implementation other than CLISP or SBCL, and if I can install it on my computer, then I'll figure it out.