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

CSC 151 - Naming values with local bindings

eikmeier.sites.grinnell.edu · 4,389 words · saved by 1 readers

When writing programs and algorithms, it is useful to name values we compute along the way. For example, in an algorithm that, given a list of numbers, sorts that list of numbers, it may be useful to name the sorted list along the way. When we associate a name with a value, we say that we bind that name to the value. So far we’ve seen three ways in which names are bound to values in Scheme. As you develop more and longer procedures, you will find that there are many times you want to create local names for values that are not parameters. We will consider such names in this reading. You will find that there are many times when you are designing algorithms that you end up telling the computer to do the same thing again and again and again. For example, here’s a bit of code that determines the ratio of vowels to consonants and let’s see how well it works. ‘Eh. It’s good enough for now. But there’s a problem with the design. We’re repeating some work. Please identify some points at which w

CSC 151 - Naming values with local bindings Naming values with local bindings Due Monday, 29 September 2025 --> Summary Algorithm designers regularly find it useful to name the values their algorithms process. We consider why and how to name new values that are only available within a procedure. Introduction When writing programs and algorithms, it is useful to name values we compute along the way. For example, in an algorithm that, given a list of numbers, sorts that list of numbers, it may be useful to name the sorted list along the way. When we associate a name with a value, we say that we

Explore this link on the map →

saved by

related reading