仅当被调用的函数结束时,粘液才会打印我的(格式...)调用 [英] slime prints my (format ...) calls only when called function ends
问题描述
我安装了 emacs + sbcl + slime.我定义了这个函数
I have emacs + sbcl + slime installed. I have this function defined
(defun jugar ()
(let* ((nodoActual *nodo-inicial*)
(estadoActual (nodo-estado nodoActual))
(timeStart nil)
(timeEnd nil)
)
(loop while (not (es-estado-final estadoActual)) do
(setf *hojas* 0)
(setf timeStart (get-universal-time))
(setf nodoActual (decision-minimax nodoActual *profundidad* timeStart))
(setf timeEnd (get-universal-time))
(setf estadoActual (nodo-estado nodoActual))
(imprime-en-fichero estadoActual)
(format t "Hojas analizadas: ~a ~%" *hojas*)
(format t "Tiempo empleado: ~a ~%~%" time))
))
进行一系列调用并在循环中打印一些变量.
that makes a series of calls and print some variables in a loop.
问题是当我从 *slime-repl sbcl*
缓冲区调用 (jugar)
时,提示一直等到 (jugar)
执行结束以将所有 (format ...)
显示在一起.我从终端(运行 sbcl)尝试了同样的方法,效果很好,所以我猜这与 emacs 或 slime 相关.我该如何解决?
The problem is when I call (jugar)
from the *slime-repl sbcl*
buffer, the prompt waits until (jugar)
execution ends for showing all the (format …)
together. I tried the same from a terminal (running sbcl) and it works well, so I guess it is something related to emacs or slime. How can I fix it?
推荐答案
在最后一次(格式)调用之后添加(强制输出).
Add (force-output) after last (format ) call.
这篇关于仅当被调用的函数结束时,粘液才会打印我的(格式...)调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!