#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
#columns:Front	Back	Tags
Crafting Interpreters ch 24, Calls and Functions: what does it cover?	Function objects, call frames, a compiler per function, the call instruction, return, stack traces for errors, and native functions.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::about
Crafting Interpreters ch 24, Calls and Functions: why does it matter?	Call frames are exactly how your CPU and every runtime manage function calls. After this chapter, stack traces make complete sense.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::why
Crafting Interpreters ch 24, Calls and Functions: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::part
Crafting Interpreters ch 24: what traps should you watch for?	<ul><li>Wrong slot offset for the callee and arguments in a frame.</li><li>Not checking frame count for stack overflow on deep recursion.</li><li>Forgetting to update the cached frame pointer after a call or return.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::traps
Crafting Interpreters ch 24: which end-of-chapter challenges are worth your time?	Challenge 1 (cache ip in a local or register) is a real speedup worth measuring. Challenges 2 and 3 (arity and error handling for natives) make the VM safer. Challenge 4 (add your own natives) is fun.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::challenges
Crafting Interpreters ch 24, Calls and Functions: how should you work through it?	One of the biggest chapters; plan two sessions. Draw the value stack and frames during a recursive call. Compare your Fibonacci benchmark against jlox from chapter 10.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::approach
