munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.87k stars 1.04k forks source link

3.9.4 someVariable instead of Breakfast? #1145

Closed VirtualNonsense closed 11 months ago

VirtualNonsense commented 11 months ago

Hey! So far I'm enjoying your book a lot! Here is something i noticed though. In 3.9.4 within the second code block you pass a reference to BreakFast into the method instead of the freshly created instance of that class. Was that on purpose?

// Store it in variables.
var someVariable = Breakfast;

// Pass it to functions.
someFunction(Breakfast);

Thank you for making this publicly available!

Edit: Misread the paragraph above...