'(报价单)在方案中 [英] '(quote quote) in scheme
问题描述
我正在尝试自己学习方案.谁能告诉我为什么 '(quote quote)
会输出 'quote
,而 '(quote 'quote)
会输出 ''报价
?
I'm trying to learn scheme by myself. Could anyone tell me why '(quote quote)
will output 'quote
, and '(quote 'quote)
will output ''quote
?
非常感谢!
推荐答案
这个表达式:
'(quote quote)
... 将 '
展开为 (quote
后等价于 (quote (quote quote))
code>,注意符号quote
被引用 两次,这个表达式被计算并打印为''quote
.
... after expanding '<something>
to (quote <something>)
is equivalent to (quote (quote quote))
, notice that the symbol quote
is being quoted two times, and this expression is evaluated and printed as ''quote
.
另一方面,这个表达式:
On the other hand, this expression:
'(quote 'quote)
...等价于(quote(quote(quote quote)))
,注意符号quote
被引用三个次,这个表达式被计算并打印为 '''quote
.
... is equivalent to (quote (quote (quote quote)))
, notice that the symbol quote
is being quoted three times, and this expression is evaluated and printed as '''quote
.
这篇关于'(报价单)在方案中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!