#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::Crafting Interpreters::Ch 09 Control Flow
#columns:Front	Back	Tags
Crafting Interpreters ch 9, Control Flow: what does it cover?	Control flow: if/else, logical operators with short-circuiting, while loops, and for loops implemented by desugaring into while. Lox becomes Turing-complete.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::about
Crafting Interpreters ch 9, Control Flow: why does it matter?	Desugaring (implementing a feature by rewriting it into simpler features) is a key compiler technique. Short-circuit evaluation shows up in every language.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::why
Crafting Interpreters ch 9, Control Flow: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::part
Crafting Interpreters ch 9: what traps should you watch for?	<ul><li>The dangling else: make sure else binds to the nearest if.</li><li>Logical operators must return the operand value, not a converted boolean.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::traps
Crafting Interpreters ch 9: which end-of-chapter challenges are worth your time?	Challenge 3 (add break) is the one to implement; it is a good exercise in parser state and in using an exception or flag to unwind. Challenges 1 and 2 are thought exercises. 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::09 cracked.guide::kind::challenges
Crafting Interpreters ch 9, Control Flow: how should you work through it?	After implementing for-loop desugaring, print the AST of a for loop to see the rewritten while loop.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::approach
