opCode book v1 errata and other notes
- paperback ISBN: 978-1-7343145-0-2
- ePub ISBN: 978-1-7343145-1-9
- Kindle ASIN: B082P92GGN
I recently discovered a bug that affects the book as well as the 0.6 version of langur. It is fixed in 0.6.14 and 0.5.10, available for download now. It has to do with setting and retrieving "non-local" values within the try section of a try/catch. Please see the known bugs page on langurlang.org for a description of the bug and how to fix it.
p. 8 — The following line ...
bug("Make", fmt.Sprintf("Operand Count Mismatch ...") ... )
... should have been ...
bug("Make", fmt.Sprintf("Operand Count Mismatch ...", ... ))
Obviously, in removing code to fit the book, I made a boo boo.
p. 32 — "You may use Linux or Windows line returns."
This is not an error, but something to note. The use of Windows line returns in langur source code is now deprecated (may not work in a future version). Any decent text editor will work with Linux line endings (not Notepad).
p. 32 — "It would good"
p. 32 — In v1.0, I used the acronym GUI, without saying what it means with it's first occurrence. That's bad form. GUI means graphical user interface.
p. 36 — "Note that conditional jumps pop the value they test off the stack, whether the test succeeds or fails."
Note that this occurs without an OpPop instruction.
p. 93 — "they will indexed"
That is, "they will be indexed."
p. 94 — "You’ll remember that “free” symbols are values outside of a function closed over at the point of a function’s definition. So, free symbols are defined by resolveSymbol()."
How would you remember it, if we haven't talked about it yet? This is discussed in the “user-defined functions” chapter.
p. 95 — unnecessary append to a nil slice ...
ins = append(ins, opcode.Make( opcode.OpSetNonLocal, sym.Index, level)...)
... should be ...
ins = opcode.Make(opcode.OpSetNonLocal, sym.Index, level)
p. 119 — "so that flag"
"so that a flag"
p. 129 — "The finished signal will not be sent until builtins.Call() has returned, with or without a panic."
Note that this will not happen in the middle of a response because the builtin is blocked awaiting the response from the VM.
p. 141 — "Look back at the compileBreak() method we looked at a short while ago" ...
This should probably read, "We will look at the compileBreak() method shortly."
p. 163 — "break, next, fallthrough. throw, or return statement"
has a period where a comma belongs
p. 165 — "And finally finally"
This wasn't really an error, but an informality. I was saying that now we're really at the final point of this section, as I used the term "and finally" earlier.
Someone might say leaving out a comma between "And" and "finally" is an error. My grandmother, the English teacher, said that you place a comma where you would pause in a sentence.
p. 165 — "each test/action having their own scope"
"each test/action having its own scope"
p. 167 — "accordingly to what I’ve read"