只有当被叫功能结束时,粘贴才会打印我的(格式)调用 [英] slime prints my (format ...) calls only when called function ends

查看:139
本文介绍了只有当被叫功能结束时,粘贴才会打印我的(格式)调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了emacs + sbcl + slime。我有这个函数定义

 (defun jugar()
(let *((nodoActual * nodo-inicial *)
(estadoActual(nodo-estado nodoActual))
(timeStart nil)
(timeEnd nil)

(循环while(not(es-estado-final estadoActual ))
(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)
(格式tHojas analizadas:〜 a〜%* hojas *)
(格式tTiempo empleado:〜a〜%〜%时间))
))

pre
$ b $ p $ code>(jugar)从 * slime-repl sbcl * 缓冲区,prom pt等待直到(jugar)执行结束,以显示所有的(format ...)。我尝试从终端(运行sbcl)相同,它的运行良好,所以我想这是与emacs或粘液有关的东西。如何解决?

解决方案

在最后一次(格式)调用后添加(强制输出)。 $ b

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.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆