以下方案将显示什么?
What would the following display in scheme?
我在几个(在线)方案中尝试过这个表达式 interpreters/parsers 有时会得到不同的答案。对于以下表达式:
(display "okkk") \; "ok;" ;"ok"
它会显示什么 and/or return?为什么?例如:
\
在 s 表达式之外是否可以接受,它们是否转义下一个字符?
- 如何在表达式之外解释字符串,或者它是无效的?
这可能取决于您的实现可能支持的 Scheme 语法。
例如,人们可能期望:
(display "okkk") -> displays okkk
\; -> error: unbound variable
"ok;" -> displays nothing, but returns the string
;"ok" -> end of line comment
我在几个(在线)方案中尝试过这个表达式 interpreters/parsers 有时会得到不同的答案。对于以下表达式:
(display "okkk") \; "ok;" ;"ok"
它会显示什么 and/or return?为什么?例如:
\
在 s 表达式之外是否可以接受,它们是否转义下一个字符?- 如何在表达式之外解释字符串,或者它是无效的?
这可能取决于您的实现可能支持的 Scheme 语法。
例如,人们可能期望:
(display "okkk") -> displays okkk
\; -> error: unbound variable
"ok;" -> displays nothing, but returns the string
;"ok" -> end of line comment