flâneur — a map of the web's best reading

CSC 151 - Boolean values and predicate procedures

eikmeier.sites.grinnell.edu · 2,359 words · saved by 1 readers

When writing complex programs, we often need to ask questions about the values with which we are computing. For example, should this entry come before this other entry when we sort the entries in a table or is this location within 100 miles of this second location? Frequently, these questions, which we often phrase as tests (not the same as unit tests), are used in control structures. For example, we might decide to do one thing if a value is a string and another if it is an integer. To express these kinds of questions, we need a variety of tools. First, we need a type in which to express the valid answers to questions. Second, we need a collection of procedures that can answer simple questions. Third, we need ways to combine questions. Finally, we need control structures that use these questions. In the subsequent sections of this reading, we consider each of these issues. We will return to more complex control structures in another reading. A Boolean value is a datum that reflects th

CSC 151 - Boolean values and predicate procedures Boolean values and predicate procedures Due Friday, 12 September 2025 --> Summary Many of Scheme’s control structures, such as conditionals (which you will learn about in a subsequent reading), need mechanisms for constructing tests that return the values true or false . These tests can also be useful for gathering information about a variety of kinds of values. In this reading, we consider the types, basic procedures, and mechanisms for combining results that support such tests. Introduction When writing complex programs, we often need to ask

Explore this link on the map →

related reading