You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Section 24.5.3 has to do with printing stack traces. It ends with entering in a broken program to demonstrate the stack trace.
fun a() { b(); }
fun b() { c(); }
fun c() {
c("too", "many");
}
a();
If you run the program from the REPL by creating each definition in turn then at this point in the chapter you will produce a segfault after you enter in the second function. (Really it works with any pair of statements you enter.) This is fixed in the next section (24.5.4) because we add in return values so all's well that ends well.
However, I would recommend adding a note next to the example that warns the user that they will get a SegFault from the REPL, but not from a file. (It could even include a cheeky author comment asking the reader to consider why this might be the case.)
I burned an hour trying to figure out why the vm.frameCount underflowed (That's C, baby!) and where I deviated from the book as written. Turns out everything was working as expected. I just needed to keep following the book.
Thanks for writing this lovely book and putting it online! Really appreciate it!
The text was updated successfully, but these errors were encountered:
Section 24.5.3 has to do with printing stack traces. It ends with entering in a broken program to demonstrate the stack trace.
If you run the program from the REPL by creating each definition in turn then at this point in the chapter you will produce a segfault after you enter in the second function. (Really it works with any pair of statements you enter.) This is fixed in the next section (24.5.4) because we add in return values so all's well that ends well.
However, I would recommend adding a note next to the example that warns the user that they will get a SegFault from the REPL, but not from a file. (It could even include a cheeky author comment asking the reader to consider why this might be the case.)
I burned an hour trying to figure out why the
vm.frameCount
underflowed (That's C, baby!) and where I deviated from the book as written. Turns out everything was working as expected. I just needed to keep following the book.Thanks for writing this lovely book and putting it online! Really appreciate it!
The text was updated successfully, but these errors were encountered: