SICP

1.1.2 Naming and the Environment
Constant declaration is our language’s simplest means of abstraction, for it allows us to use simple names to refer to the results of compound operations, such as the circumference computed above.
常量声明是语言最简单的抽象方法,它允许使用 简单的名称 来引用 复合运算 的结果,例如上面计算的周长。

It should be clear that the possibility of associating values with names and later retrieving them means that the interpreter must maintain some sort of memory that keeps track of the name-object pairs. This memory is called the environment (more precisely the program environment, since we will see later that a computation may involve a number of different environments).
将值与名称相关联 并在以后检索它们 意味着解释器必须维护某种内存来跟踪 名称-对象 对。 该内存称为环境。

Chapter 3 will show that this notion of environment is crucial, both for understanding how the interpreter works and for implementing interpreters. 关于环境的概念是至关重要的,不仅在于理解编译器如何工作,也在于如何实现编译器

1.1.3 Evaluating Operator Combinations
To evaluate an operator combination, do the following:

  1. Evaluate the operand expressions of the combination.
  2. Apply the function that is denoted by the operator to the arguments that are the values of the operands.

如何计算一个操作符组合1.evaluate组合中的 操作数的表达式 2.将操作符表示的函数 应用于 作为操作数数值的参数。

Thus, the evaluation rule is recursive in nature; that is, it includes, as one of its steps, the need to invoke the rule itself.
这个计算规则自然是递归的,也就是作为其中一个步骤,需要调用规则本身

In general, we shall see that recursion is a very powerful technique for dealing with hierarchical, treelike objects. In fact, the percolate values upward form of the evaluation rule is an example of a general kind of process known as tree accumulation.
递归是处理 层级结构,树样对象,的一种非常强大的技术。事实上,计算规则的“向上渗透值”形式是一种称为“树积累”的一般过程的示例。
image.png
Next, observe that the repeated application of the first step brings us to the point where we need to evaluate, not combinations, but primitive expressions such as numerals or names. We take care of the primitive cases by stipulating that

  • the values of numerals are the numbers that they name, and
  • the values of names are the objects associated with those names in the environment.

重复第一步将得到 evaluate 需要的点,也就是一些原始表达式,也就是一些基本数字,一些通过名称声明的数字

the general notion of the environment as providing a context in which evaluation takes place will play an important role in our understanding of program execution.
环境的基本概念是 提供一个 context 作为进行 evaluation 的地方

The letters in const are rendered in bold to indicate that it is a keyword in JavaScript. Keywords carry a particular meaning, and thus cannot be used as names. A keyword or a combination of keywords in a statement instructs the JavaScript interpreter to treat the statement in a special way. Each such syntactic form has its own evaluation rule.
语句中的关键字或关键字组合指示 JavaScript 解释器以特殊的方式处理该语句

Each such syntactic form(keyword) has its own evaluation rule.The various kinds of statements and expressions (each with its associated evaluation rule) constitute the syntax of the programming language.
每个关键字都有自己的 evaluation 规则.
keyword -> evaluation rule
程序语言的语法就是由各种各样的语句,表达式构成