TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Land Of Lisp chapter 7 - Using SBCL

24 点作者 ciaranbradley超过 14 年前

5 条评论

gibsonf1超过 14 年前
Here's a function to create svg (default) or jpg for both sbcl and lispworks from graphviz:<p>(defun make-svg (file-name &#38;key jpg)<p><pre><code> #+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) ) ) </code></pre> (defun weblog-stream ()<p><pre><code> (or (net.aserve:vhost-log-stream (net.aserve:wserver-default-vhost net.aserve:*wserver*)) t)) ;;sends output directly to html stream on portable allegroserve </code></pre> (defmacro string+ (string &#38;rest strings) `(concatenate 'string ,string ,@strings))
ciaranbradley超过 14 年前
I bought the book the other day after it was posted here: <a href="http://news.ycombinator.com/item?id=1836935" rel="nofollow">http://news.ycombinator.com/item?id=1836935</a> and have been working through the chapters. The book contains some CLISP specific code but I'm running SBCL. So this is my SBCL hack for the first stumbling block I found.<p>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.
mahmud超过 14 年前
Instead 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.<p><a href="http://common-lisp.net/project/trivial-shell/" rel="nofollow">http://common-lisp.net/project/trivial-shell/</a>
评论 #1852027 未加载
评论 #1852007 未加载
waterhouse超过 14 年前
I use this. This makes the "shell" command work in SBCL, and does nothing in CLISP or any other implementation.<p><pre><code> #+sbcl (defun shell (x) (run-program "/bin/sh" (list "-c" x) :output t)) </code></pre> 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.
flavoie超过 14 年前
A page dedicated to landoflisp on sbcl would great. clisp looks like more trouble to install on my mac than the sbcl package.
评论 #1852313 未加载
评论 #1852241 未加载