如何在通用LISP中打印文本,以便可以使用逃生序列(类似于在球拍中显示)将其格式化?
ho我是否在通用LISP中打印一个格式的输出? 在 conset 我与display> display
一样, :
(display "\33[3min italics\33[m\n")
我已经尝试了(格式t“ 〜ain italics〜A”“ \ 33 [3M” “ \ 33 [m“”)
,但不起作用。这也不是:(格式t“ 〜CIN ITALICS〜C”#\ 33 [3M#\ 33 [M)
。
Ho do I print a formatted output in Common Lisp?
In Racket I do it with display
, like so:
(display "\33[3min italics\33[m\n")
I've tried with (format t "~ain italics~a" "\33[3m" "\33[m")
but it does not work. Neither does this: (format t "~cin italics~c" #\33[3m #\33[m)
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里的主要问题是如何获得正确的字符序列。 \ 33是ASCII CHAR 27或#\ ESC中的八十个八角中。
会做你想做的。
但是您可以做得更好。有一个名为 cl-interpol ,通过修改读取器来演示常见LISP的灵活性的库,可以使用已经熟悉的语法。
例如:
The main issue here is how to get the proper sequence of characters. \33 is octal for ascii char 27 or #\Esc in Common Lisp.
would do what you want.
But you could do better than that. There is a library called cl-interpol which demonstrates flexibility of Common Lisp by modifying the reader so you could use the already familiar syntax.
For example: