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

CSC 151 - Anonymous procedures

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

You’ve learned the most common approach we will use to defining procedures. To define a procedure, you use a form like the following. If we wanted to define a procedure, add, that adds two values, we might write something like the following. However, you’ve already seen another way to define a procedure. Instead of the lambda expression, you can use define to give another name to a procedure that already exists. For example, How are these two definitions similar? Both use the define keyword to associate a name (add) with something that defines a procedure. In the first case, it’s a lambda expression. In the second, it’s an existing procedure. Perhaps that’s not surprising. We can also define numeric values using expressions or constants. The Lisp family of languages (including Scheme) set themselves apart from many programming languages by permitting you to use a variety of kinds of expressions to define procedures. You’ve already seen two: lambda expressions and existing procedures. I

CSC 151 - Anonymous procedures Anonymous procedures Due Wednesday, 17 September 2025 --> Summary While lambda expressions are the most common way to write procedures, there are also a variety of others. We consider how to use composition and sectioning to build new procedures from old. Introduction You’ve learned the most common approach we will use to defining procedures. To define a procedure, you use a form like the following. ( define <identifier> ( lambda ( <arguments> <expression> ))) If we wanted to define a procedure, add , that adds two values, we might write something like the follow

Explore this link on the map →

saved by

related reading