'(报价单)在方案中 [英] '(quote quote) in scheme

查看:34
本文介绍了'(报价单)在方案中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自己学习方案.谁能告诉我为什么 '(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆