开发者

How do you break long string lines in Scheme?

开发者 https://www.devze.com 2022-12-19 02:28 出处:网络
For example, I want to开发者_高级运维 break the long string in the below panic statement: (panic \"Truth-assignment length is longer than the number of propositions!\")

For example, I want to开发者_高级运维 break the long string in the below panic statement:

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

I have tried

(panic "Truth-assignment length is longer than the number \

of propositions!")

and

(panic "Truth-assignment length is longer than the number

of propositions!")

and they both don't work. Googling hasn't turned up anything either.


Use string-append with the built-in formatting of your IDE:

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


Not all Scheme specifications define a way to break long strings. The answer to your question depends on which Scheme you are using. I believe R6RS includes a method like the first one you tried. Others might provide no such option, forcing you to either reduce the length of your strings, have very long lines, or use string-append with smaller strings.

Have a look at these links: http://www.mail-archive.com/r6rs-discuss@lists.r6rs.org/msg01810.html http://practical-scheme.net/gauche/ (search for 2008/2/13)

0

精彩评论

暂无评论...
验证码 换一张
取 消