Chapter 4. (Conditions and Decisions)

#|

You’ve now seen Racket’s simple syntax and a bunch of different kinds of data. But can you write a program that answers a question about some piece of data? And can you write a program that chooses different values depending on the answers to these questions? In this chapter, we’ll look at predicates and different forms of conditional evaluation. Among them is an extremely elegant multi-branch conditional that Racketeers use as their major workhorse for many of their programming tasks.

|#

4.1 How to Ask

Racketeers think of a conditional as a form that asks questions about values and, depending on the answers, evaluates the appropriate expression. It is therefore natural that this chapter shows you how to ask ...

Get Realm of Racket 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.