Structure And Interpretation Flashcards
Can Lisp processes become data?
Yes. Lisp descriptions of processes, called procedures, can themselves be represented and manipulated as Lisp data.
What is the ethical definition of formalism?
A doctrine stating that acts are right or wrong of themselves regardless of consequences.
What is the mathematical definition of formalism?
A doctrine that mathematics, including the logic used in proofs, can be based on the formal manipulation of symbols without regard to their meaning.
In what year was Lisp invented?
1958
What active language is older than Lisp?
Fortran, specified in 1957
Who conceived of Lisp?
John McCarthy in his paper “Recursive Functions of Symbolic Expressions and Their Computation by Machine.”
What is a Lisp interpreter?
It is a machine that carries out processes described in the Lisp language.
A powerful programming language is a means for instructing a computer to perform tasks, and what else?
The language also serves as a framework within which we organize our ideas about processes.
Describe the three ways in which powerful computer languages turn simple ideas into complex ideas.
- Primitive expressions, which represent the simplest entities the language is concerned with. 2. means of combination, by which compound elements are built from simpler ones, and 3. means of abstraction, by which compound elements can be named and manipulated as units.
What are the two elements with which programming deals?
Procedures
Data
Define Evaluate
To find the value of
One kind of primitive expression you might type is a number. What, precisely, is happening when you type a number?
More precisely, the expression that you type consists of the numerals that represent the number in base 10.
(+ 3 4)
Describe what, precisely, this is?
Expressions representing numbers may be combined with an expression representing a primitive procedure (such as + or *) to form a compound expression that represents the application of the procedure to those numbers.
How do expressions become combinations?
Combinations are formed by delimiting a list of expressions within parentheses in order to denote procedure application.
How is a combination evaluated?
The value of a combination is obtained by applying the procedure specified by the operator to the arguments that are the values of the operands.
Define Delimit
To officially set or state the limits of something.
What is the difference between a parameter and an argument?
The term parameter (sometimes called formal parameter) is often used to refer to the variable as found in the function definition, while argument (sometimes called actual parameter) refers to the actual value passed.
What is one good reason for prefix notation?
Prefix notation has several advantages. One of them is that it can accommodate procedures that may take an arbitrary number of arguments:
(+ 32 33 33 32 23 233 233 3322 323 … n)
Define “pretty printing” as it pertains to Lisp
A convention in which each long combination is written so that the operands are aligned vertically.
A critical aspect of a programming language is the means it provides for using names to refer to computational objects. How do we describe this?
We say that the name identifies a variable whose value is the object.
What is Lisp’s simplest means of abstraction?
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.
How are complex programs constructed?
Complex programs are constructed by building, step by step, computational objects of increasing complexity.
What follows from the possibility of associating values with symbols and later retrieving them?
It should be clear that the possibility of associating values with symbols and later retrieving them means that the interpreter must maintain some sort of memory that keeps track of the name-object pairs. This memory is called the environment (more precisely the global environment, since we will see later that a computation may involve a number of different environments).
How are primitive cases dealt with when evaluating an expression?
We take care of the primitive cases by stipulating that:
the values of numerals are the numbers that they name,
the values of built-in operators are the machine instruction sequences that carry out the corresponding operations, and
the values of other names are the objects associated with those names in the environment.
(The second is a special case of the third, where built-in operators themselves are objects associated with names.)