gpt4 book ai didi

lisp - 普通口齿不清 : Hunchentoot and the REPL - When I start the server I get log output in the REPL and can't use the REPL any more

转载 作者:太空宇宙 更新时间:2023-11-03 18:33:15 26 4
gpt4 key购买 nike

和这里的一些提问者一样,我是 Lisp 的新手。我正在浏览 Practical Common Lisp书,但回过头来看看设置网络应用程序有多么容易,所以我一直在关注 this教程,以及 updated version here .

当我到达启动服务器的位置时,我的 REPL 死了,然后我无法将任何内容推送到 *dispatch-table*

所以基本上,我的代码在 REPL 中运行良好,将对象添加到列表,检索它们等,然后我使用

启动服务器
(setf *web-server* (start (make-instance 'hunchentoot:acceptor :port 8080)))

效果很好,我可以在 http://localhost:8080 上访问它。但是,当我访问它时,日志会打印到 REPL,从那时起我无法实际使用 REPL。因此,例如,在 Adam Petersen 的帖子之后,我不能

(push (create-prefix-dispatcher "/retro-games.htm" 'retro-games) *dispatch-table*)

因为 REPL 没有响应。我试过从不同的窗口(即从终端中的 SBCL)启动服务器,但它不知道我所处的环境——它不理解我正在处理的包或我的任何代码。

我使用了一个稍微不标准的设置;我在 OSX 上使用带有 SublimeREPL 和 SBCL 的 Sublime Text 2(因为我真的不喜欢 Emacs 而 ST2 很棒!)。我已经描述了我是如何把它们放在一起的 here - 但我真的只是为了以防万一,如果是我的设置导致问题而不是我缺少的一些基本东西,我会感到惊讶。

无论如何,我知道我可以继续在更像生产的环境中设置 hunchentoot,并且已经看到一些帖子详细说明了这一点并远程访问了 REPL,但我希望有一些更简单的东西来搞乱我刚刚错过了。

最佳答案

确保您的 SBCL 编译时支持线程。单线程运行时,Hunchentoot 请求处理循环不会返回到 REPL。

线程不是 http://www.sbcl.org/ 的二进制文件中的默认设置对于 Mac OS X。在 Mac OS X 上,我通常下载 sbcl.org 二进制文件以开始使用,然后下载源代码并使用 ./make.sh --fancy 重建以获得一些花哨的东西功能,包括线程。有关详细信息,请参阅源中的 INSTALL 文档。

关于lisp - 普通口齿不清 : Hunchentoot and the REPL - When I start the server I get log output in the REPL and can't use the REPL any more,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17594533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com