Python 有:
"""
line1
line2
line3
"""
如何在Common Lisp中做到这一点?
这只是一个常规字符串:
"
line1
line2
line3
"
但是,您需要转义内部双引号字符。
如果您不想转义引号,则必须更改可读性。事实上,通过使用 cl-interpol 库,您可以轻松地获得您想要的行为(以及更多),该库定义了字符串的自定义语法,特别是不同类型的外部分隔符。
CL-USER> (ql:quickload :cl-interpol)
...
CL-USER> (interpol:enable-interpol-syntax)
; No value
CL-USER> #?(some string)
"some string"
CL-USER> #?(some string with a "string" inside)
"some string with a "string" inside"
CL-USER> #?(some string with (nested (parentheses)))
"some string with (nested (parentheses))"