Chapter 4. Control Structures and Method Dispatch
YARV uses its own internal set of control structures, like the structures you use in Ruby.
In Chapter 3 I explained how YARV uses a stack while executing its instruction set and how it can access variables locally or dynamically. Controlling the flow of execution is another fundamental requirement for any programming language, and Ruby has a rich set of control structures, too. How does YARV implement control structures?
Like Ruby, YARV has its own control structures, albeit at a much lower level. Instead of if
or unless
statements, YARV uses two low-level instructions called branchif
and branchunless ...
Get Ruby Under a Microscope now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.