Structure and Interpretation of Computer Programs
We have seen that procedures are, in effect, abstractions that describe compound operations on numbers independent of the particular numbers. For example, when we (define (cube x) (* x x x)) we are not talking about the cube of a particular number, but rather about a method for obtaining the cube of any number. Of course we could get along without ever defining this procedure, by always writing expressions such as (* 3 3 3) (* x x x) (* y y y) and never mentioning cube explicitly. This would place us at a serious disadvantage, forcing us to work always at the level of the particular operations that happen to be primitives in the language (multiplication, in this case) rather than in terms of higher-level operations. Our programs would be able to compute cubes, but our language would lack the ability to express the concept of cubing. One of the things we should demand from a powerful programming language is the ability to build abstractions by assigning names to common patterns and then
Structure and Interpretation of Computer Programs [Go to first , previous , next page ; contents ; index ] 1.3 Formulating Abstractions with Higher-Order Procedures We have seen that procedures are, in effect, abstractions that describe compound operations on numbers independent of the particular numbers. For example, when we (define (cube x) (* x x x)) we are not talking about the cube of a particular number, but rather about a method for obtaining the cube of any number. Of course we could get along without ever defining this procedure, by always writing expressions such as (* 3 3 3) (* x x
Explore this link on the map →saved by
related reading
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- CSC 151 - Anonymous procedureseikmeier.sites.grinnell.edu
- Lambda calculus - Wikipediaen.wikipedia.org
- CSC 151 - Writing your own procedureseikmeier.sites.grinnell.edu
- Structure and Interpretation of Computer Programs, 2e: 1.2sarabander.github.io
- CSC 151 - Higher-order design, recursive and othereikmeier.sites.grinnell.edu
- Up and Down the Ladder of Abstractionworrydream.com