#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
#columns:Front	Back	Tags
Crafting Interpreters ch 11, Resolving and Binding: what does it cover?	A static resolver pass that walks the AST before execution and records, for each variable use, how many scopes up its definition is. This fixes a closure bug caused by mutable environments and adds compile-time errors like reading a local in its own initializer.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::about
Crafting Interpreters ch 11, Resolving and Binding: why does it matter?	This is your first semantic analysis pass. Linters, type checkers and compilers all work this way: a separate walk over the tree that computes facts about it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::why
Crafting Interpreters ch 11, Resolving and Binding: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::part
Crafting Interpreters ch 11: what traps should you watch for?	<ul><li>Forgetting to resolve some node type, which leaves variables silently treated as globals.</li><li>Mismatched beginScope/endScope calls.</li><li>Resolving a function body in the wrong function type context, which breaks later return checks.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::traps
Crafting Interpreters ch 11: which end-of-chapter challenges are worth your time?	Challenge 3 (error on unused locals) is a nice small analysis to add. Challenge 4 (store locals in arrays indexed by slot instead of maps) is a real performance improvement and previews clox. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::challenges
Crafting Interpreters ch 11, Resolving and Binding: how should you work through it?	Before reading the fix, run the example that shows the bug and make sure you understand why it misbehaves. Then implement the resolver. This chapter is subtle; plan for extra time.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::approach
