【问题标题】:How do you break long string lines in Scheme?如何在 Scheme 中打断长字符串?
【发布时间】:2011-01-13 16:42:59
【问题描述】:

例如,我想在下面的恐慌语句中打破长字符串:
(panic "Truth-assignment length is longer than the number of propositions!")

我试过
(panic "Truth-assignment length is longer than the number \
of propositions!")


(panic "Truth-assignment length is longer than the number
of propositions!")

他们都不起作用。谷歌搜索也没有发现任何东西。

【问题讨论】:

    标签: scheme newline escaping line-breaks long-lines


    【解决方案1】:

    在 IDE 的内置格式中使用 string-append:

    (panic (string-append "Truth-assignment length is longer " 
                          "than the number of propositions!"))
    

    【讨论】:

      【解决方案2】:

      并非所有的 Scheme 规范都定义了一种断开长字符串的方法。您的问题的答案取决于您使用的方案。我相信 R6RS 包含一种方法,就像您尝试的第一个方法一样。其他人可能没有提供这样的选项,迫使您要么减少字符串的长度,要么使用很长的行,或者使用字符串附加更小的字符串。

      看看这些链接: http://www.mail-archive.com/r6rs-discuss@lists.r6rs.org/msg01810.html http://practical-scheme.net/gauche/(搜索2008/2/13)

      【讨论】:

        猜你喜欢
        • 2016-11-05
        • 2017-09-15
        • 2018-06-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-03-07
        相关资源
        最近更新 更多