Behavour of nested quotes in Scheme and Racket

偶尔善良 提交于 2019-11-29 14:14:41

Putting a quote mark (') around a term and wrapping a quote form around it are identical. That is, they read to the same term.

So all of the following expressions are identical in Scheme:

''a
'(quote a)
(quote 'a)
(quote (quote a))

The quote form means "interpret what comes next as a datum---even if it contains another quote". The sub-term is parenthesized, so it's a list; the inner quote is just a symbol.

In some cases, the printer uses reader-abbreviations like the quote mark (') in its output. I'm a little surprised that you got write to do it, though; for me, it always writes as (quote a).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!