Original JavaScript
Original JavaScript
Dotted tail notation is unnecessary in the JavaScript edition. We simply use the pair constructor rather than the list constructor when we want to refer to the rest of a list, as shown in section 4.4.1. See also section 4.4.4.7.
Original JavaScript
Original JavaScript
Original JavaScript

[1] In general, unifying ?y with an expression involving $y with an expression involving ?y $y would require our being able to find a fixed point of the equation ?y $ = \textit{expression involving}$ ?y. $y $ = \langle$$expression$ $involving$ $y$\rangle$. It is sometimes possible to syntactically form an expression that appears to be the solution. For example, ?y It is sometimes possible to syntactically form an expression that appears to be the solution. For example, $y $=$ (f ?y) list("f", $y) seems to have the fixed point (f (f (f ))), list("f", list("f", list("f",))), which we can produce by beginning with the expression (f ?y) list("f", $y) and repeatedly substituting (f ?y) list("f", $y) for ?y. $y. Unfortunately, not every such equation has a meaningful fixed point. The issues that arise here are similar to the issues of manipulating infinite series in mathematics. For example, we know that 2 is the solution to the equation $y = 1 + y/2$. Beginning with the expression $1 + y/2$ and repeatedly substituting $1 + y/2$ for $y$ gives \[ 2 \ = \ y \ = \ 1 + y/2 \ = \ 1 + (1+y/2)/2 \ = \ 1 + 1/2 + y/4 \ = \ \cdots, \] which leads to \[ 2 \ = \ 1 + 1/2 + 1/4 + 1/8 +\cdots. \] However, if we try the same manipulation beginning with the observation that $-1$ is the solution to the equation $y \ = \ 1 + 2y$, we obtain \[ -1 \ = \ y \ = \ 1 + 2y \ = \ 1 + 2(1 + 2y) \ = \ 1 + 2 + 4y \ = \ \cdots, \] which leads to \[ -1 \ = \ 1 + 2 + 4 + 8 +\cdots. \] Although the formal manipulations used in deriving these two equations are identical, the first result is a valid assertion about infinite series but the second is not. Similarly, for our unification results, reasoning with an arbitrary syntactically constructed expression may lead to errors.
Original JavaScript
[2] The actual way to get the string that contains the first character of a string s in JavaScript is s.charAt(0).
[3] Creating new variables with string concatenation and identifying variables by checking their first character during query processing is somewhat wasteful. A more efficient solution would mark pattern variables with a separate tag in the query-language-specific representation and use pair construction rather than string concatenation to create new variables. We chose the less efficient solution to simplify the presentation.
[4] Most Lisp systems give the user the ability to modify the ordinary read procedure to perform such transformations by defining reader macro characters. Quoted expressions are already handled in this way: The reader automatically translates 'expression into (quote expression) before the evaluator sees it. We could arrange for ?expression to be transformed into (? expression) in the same way; however, for the sake of clarity we have included the transformation procedure here explicitly.

Expand-question-mark and contract-question-mark use several procedures with string in their names. These are Scheme primitives.
4.4.4   Implementing the Query System