本文介绍了write,print,pprint,princ和prin1有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Lisp,并且遇到了各种不同的功能,这些功能对我来说似乎是在做同样的事情...即打印到控制台...那么所有这些不同之间的区别到底是什么?功能?
I'm getting into some Lisp, and I've come across various different functions that to me appear to be doing the same thing... Namely printing to console... So what exactly is the difference between all those different functions?
推荐答案
在这里得到答案: http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_pr.htm
-
write
是Lisp打印机的常规入口点. -
prin1
生成适合于read
输入的输出. -
princ
与prin1
相似,除了输出没有转义字符.princ
旨在使人看起来不错,而prin1
的输出旨在被功能read
接受. -
print
与prin1
相似,除了对象的打印表示形式之前带有换行符,然后带有空格. -
pprint
产生漂亮的输出.
write
is the general entry point to the Lisp printer.prin1
produces output suitable for input toread
.princ
is just likeprin1
except that the output has no escape characters.princ
is intended to look good to people, while output fromprin1
is intended to be acceptable for the functionread
.print
is just likeprin1
except that the printed representation of object is preceded by a newline and followed by a space.pprint
produces pretty output.
这篇关于write,print,pprint,princ和prin1有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!