Print output into a file or not print output?

后端 未结 3 1507
臣服心动
臣服心动 2021-01-13 13:51

I\'d like to save or ignore outputs when I execute a specific function in lisp. I use Emacs and CCL. For example,

(defun foo (x) (format t \"x = ~s~%\" x))
         


        
3条回答
  •  半阙折子戏
    2021-01-13 14:20

    Instead of t as the first argument to format, you can give it an output file stream and your output for that statement will be sent to that file stream.

    However having excessive disk I/O will also will increase your running time, hence you can consider having two modes like a debug and a release mode for your program where the debug mode prints all the diagnostic messages and the release mode does not print anything at all.

提交回复
热议问题