Chapter 4Evaluate Code in Context
So far you’ve seen the building blocks for writing macros, and you’ve learned why they aren’t the ideal solution for every problem. In the remainder of this book, we’ll look at several broad categories of macros to learn how you can clarify your code’s intentions, add your own control flow mechanisms, and take advantage of your other macro superpowers.
In this chapter, you’ll see macros that wrap the code they’re given into a new context for evaluating them. For example, you might want to evaluate a given expression with dynamic bindings, within a try/catch block, or where a resource is opened and then cleaned up. In this category of macros, you’re not doing anything too fancy with the input expressions—they’re ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access