Comments on the Tucker and Noonan book (including some problems that may be fixed in later printings):
Pages 84-85: The definitions given here for "Turing comlete" and "imperative" are nonstandard. In standard parlance, a Turing-complete language is one that can express all the same computations as a Turing machine, independent of how those computations are expressed. A language can be Turing-complete without containing assignment statements, for example. (Think of the subset of Scheme taught in MCS-177, for example.) An imperative programming language, as conventionally understood, is one in which programs are structured primarily as a sequence of state-transforming actions, such as assignment statements. This is a very broad category that includes languages whether or not they have all the bells and whistles listed on page 85.
Page 85: The first paragraph of Section 4.2 states that names in Jay are case-insensitive. However, this is at odds with the code shown in Chapter 3 and Appendix B. I will henceforth assume that Jay is in fact case sensitive, rather than assuming we need to fix the code to match the specification here.
Page 86: At the top of this page, two properties of naming are confused: whether each location has a unique name and whether each name has a unique location. In Jay, both are true.
Later on that page, the definition of typeOf uses in a very nonstandard way the sign for logical implication, ⊃. The way the sets of operators are notated is also wrong. Here is a more conventional version of the definition:
|typeOf(Expression e, TypeMap tm)|
|=||e.type||if e is a Value|
|tm(e)||if e is a Variable and e∈tm|
|int||if e is a Binary and e.op∈ArithmeticOp|
|boolean||if e is a Binary and e.op∈BooleanOp∪RelationalOp|
|boolean||if e is a Unary and e.op∈UnaryOp|
Page 87: The item numbered 3(a)
int/. The slash is a typo and should be
Page 88: The last line in the equations defining M contains the subexpression M(e(.term, σ)), which should be M(e.term, σ).
Page 89: The defintion given here for short-circuit evaluation is defective. By the time ApplyBinary is used, both subexpressions have already been evaluated, producing the values v1 and v2. Thus, no matter how the definition of ApplyBinary is massaged, the evaluation will not be short-circuit. To achieve the goal of short-circuit evaluation, the definition of M itself needs to be changed, so as not to even use ApplyBinary.
Page 91: In the fourth line after the figure, 2127-e should be 2e-127.