SICP 1 Flashcards
What are three mechanisms a programming language has for combining simple ideas to make complex ones?
Primitive expressions, means of combination, means of abstraction
What are the two elements we deal with in programming?
procedures and data
What should a powerful programming language be able to describe and have methods for?
Describing primitive data and procedures, and methods for combining and abstracting procedures and data
What do we focus on in chapter 1 of SICP?
Simple numerical data so we can focus on the rules for building procedures.
What does an interpreter do when you type an expression?
Displays the result of evaluating that expression
Name a primitive expression
a number
What can expressions representing a number be combined with?
An expression representing a primitive procedure to form a compound expression that represents the application of the procedure to those numbers
What are combinations?
Expressions formed by delimiting a list of expressions to denote procedure application.
WHat is the leftmost and other expressions called.
Operator and operands
how is the value of a combination obtained?
By applying the procedure specified by the operator to the arguments that are the values of the operands
What does a name do?
A name identifies a variable whose value is the object
Why is define the simplest method of abstraction?
It allows us to use simple names
Why is abstraction useful?
Computational objects may have complex structures and it would be inconvenient to have to remember and repeat their details every time we use them.
What is the memory called that contains the name-object pairs?
The global environment
What is one of our goals for this chapter?
To isolate issues about thinking procedurally
What is the interpreter doing while evaluating expressions?
Following a procedure
Describe how to evaluate a combination
1 Evaluate the subexpressions of the combination 2 apply the procedure that is the value of the operator to the arguments that are the values of the operands
What makes the evaluation rule recursive in nature
It includes as one of its steps the need to invoke itself
What are exceptions to the general evaluation rule called
special forms
What are procedure definitions?
A much more powerful abstraction technique by which a compound operations can be given a name and then referred to as a unit.