Closed tcard closed 7 years ago
I created a pull-request, that fixes that in clox https://github.com/munificent/craftinginterpreters/pull/42
Oof, you're right! I wrote that chapter quite a while after implementing that behavior in Lox and I'm embarrassed to admit I misremembered how my own language works!
I think the simpler fix is to update the text to describe how Lox actually behaves. In a real language, it's probably more usable to convert either operand to a string, but doing that in Lox would add a decent amount of fairly boring code, so the simplest thing is to just leave it out and leave "+" a little less flexible.
I'll fix the prose.
According to 3.4.1:
But both interpreter currently say: