Chris J. Breisch
Chris J. Breisch
I am working on my own standard library, but I haven't yet stumbled upon a need for closures in it. I think I will, though. Your post is disappointing, as...
Forgive me for resurrecting such an old thread. I think there are two challenges here. The first is the hardest and has already been discussed, so I won't bother. And...
> it says for `and`: _"It returns the left operand if it's false, or the right operand otherwise"_ and then the first example shows `true and false; // false.` which...
@brainuser5705 - Yes, that's correct. Also, there's a point to the rather confusing wording. lox doesn't just return true and false for logical expressions, but returns the values from the...
Thanks, @nocturn9x. I should point out that I misspoke earlier. I had forgotten that we use OP_LOOP for negative jumps, so we do get the full 65,535 bytes in both...
My questions revolve around #4. The obvious answer is to expand the data on the opcode past 1 byte. I think two would work. To paraphrase Bill Gates, 64k locals...
Actually, for #4, I ended up making _LONG versions of all the variable opcodes, that were 3 byte indexes instead of 1, and then a switch to the _LONG versions...
I ended up having problems with my implementation later on in the book. For now, I have backed out those changes, but will re-visit. It's important to me that I...
You can also think of it as an attribute of the class, and not the method/function. You don't need an instance of the class to invoke these objects. Maybe you...
@nocturn9x > I've tried experimenting with implementing the OP_CONSTANT_LONG opcode as suggested by the book, but found that the performance regression was significantly higher with 2 different opcodes rather than...