我将要问你两个不同的请求:

  1. 请告诉你叫什么名字
  2. 请告诉我 “你叫什么名字”

你看出来两个请求的差别了吗?

对于第一个请求,你会回答你的名字:John, Emily, Sandra, David…

对于第二个请求,你会回复:“你叫什么名字”

不同之处在于,第二个请求是引用。

Name

引用操作

目前为止,我们学会了如何让计算机 对表达式求值,像这样:

xxxxxxxxxx
 
(+ 3 4)
x
 
the evaluation will appear here (soon)...

如果我们让计算机显示表达式的原样,我们使用 quote 操作,像这样:

xxxxxxxxxx
 
(quote (+ 3 4))
xxxxxxxxxx
 
the evaluation will appear here (soon)...

随意地玩下面的输入框,让计算机引用你想要的表达式

xxxxxxxxxx
 
()
xxxxxxxxxx
 
the evaluation will appear here (soon)...

你甚至可以引用没有意义的的表达式,比如使用不存在的变量:

xxxxxxxxxx
 
(quote (a b c))
xxxxxxxxxx
 
the evaluation will appear here (soon)...

唯一限制的是你引用的表达式必须是有效的。

例如,下面的表达式运行出错,因为空括号:

xxxxxxxxxx
 
(quote (+ 3 4 ())
xxxxxxxxxx
 
the evaluation will appear here (soon)...

这个也运行出错因为 12.1.2 不是有效的数字:

xxxxxxxxxx
 
(quote (12.1.2))
xxxxxxxxxx
 
the evaluation will appear here (soon)...

你还能想到其他无效的表达式吗?

xxxxxxxxxx
 
()
xxxxxxxxxx
 
the evaluation will appear here (soon)...

Send us a screenshot with your programs to viebel@gmail.com.