Structure and Interpretation of Computer Programs

Structure and Interpretation of Computer Programs


——firo

众人力荐这里这里还有这里。。。慕其大名久已,虽说马上就大四了,而且实习也没找到,我还是挺淡定的。我想我还是要看看这本书。她会给我带来什么呢?

Chapter 1 Building Abstractions with Procedures

The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three:1. Combining several simple ideas into one compound one, and thus all complex ideas are made.2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations.3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made.——John Locke, An Essay Concerning Human Understanding (1690)
全书开篇,卷首语!含义深刻,多理解几遍,第一章都在围着这句话转!
1.1 The Elements of Programming
Every powerful language has three mechanisms foraccomplishing this:
  • primitive expressions, which represent the simplest entities the language is concerned with,
  • means of combination, by which compound elements are built from simpler ones, and
  • means of abstraction, by which compound elements can be named and manipulated as units.
two kinds of elements:
procedures and data. (Later we will discover that they are really not so distinct.)
1.1.1 Expressions
1.1.2 Naming and the Environment
Define is our language's simplest means of abstraction, for it allows us to use simple names to refer to the results of compound operations
the interpreter must maintain some sort of memory that keeps track of the name-object pairs. This memory is called the environment
1.1.3 Evaluating Combinations
Recursion is a very powerful technique for dealing with hierarchical, treelike objects
1.1.4 Compound Procedures
We have identified in Lisp some of the elements that must appear in any powerful programming language:
  • Numbers and arithmetic operations are primitive data and procedures.
  • Nesting of combinations provides a means of combining operations.
  • Definitions that associate names with values provide a limited means of abstraction.
1.1.5 The Substitution Model for Procedure Application
normal-order evaluation
applicative-order evaluation
1.1.6 Conditional Expressions and Predicates

posted on 2011-07-14 16:39  firocb  阅读(204)  评论(0编辑  收藏  举报

导航