The test format will be mostly short answer. There will be some
questions that ask you to debug some code,and others that ask you
to write some code. You won't be expected to have absolutely perfect
syntax, but you will be expected to be close enough that it is clear
what you mean.
This is just some notes that I made to myself when thinking about what
were the important things in this course:
- What's a paradigm?
- What are the three (popular) programming paradigms?
- What are the big wins of the functional paradigm? (At least if you
program in strictly functional way.)
- What are the good properties of Lisp?
- What can you say about a Lisp function (or combination of Lisp functions)
and why? Fun example:
(defun cube-root (n)
;; implement a cube-root here
)
(defun f (x y)
(g x (cube-root y)))
(defun g (x y)
(format t "x is ~S" x))
(f 10 (sqrt 64))
What is the value of y inside the call to g (during the FORMAT)? The
correct answer is 2, but the more correct answer is "it doesn't
matter" since y isn't used. A clever interpreter can use its understanding
of the subsitution model to be "lazy" and not evaluate things that are
not used. In particular in this example, neither the square root nor
the cube root need to be evaluated since there values are not used by
anyone else!
- What is the root of all evil and how does this apply to this class and
Lisp programming in general?
- What are the 4 big concepts of this course? When have we (you!) used
each one?
- What is the box representation of the functions used to make a program?
- How does the Lisp interpreter evaluate various things? When
does order of evaluation matter?
- How do you make a function get called? How do you avoid getting
something called as a function?
- What is true and false in Lisp? Why is it defined this way?
- What are functions that compute truth values called?
- What is a special form (macro)? What are the special forms that you
know?
- What is a "well-formed" list? How is it printed?
- When does a list get formed that is not "well-formed?"
How is it printed?
- How do you compute the length of a list?
- How do the following functions work: APPEND, CONS,
LIST? (How do they function with recursion?)
- What do CAR, CDR, FIRST, and REST do?
What is their relationship to each other? What type of values must
be passed as arguments to these functions?
- Why is NIL a special value? Is it a list or an atom?
What is the FIRST and the REST of NIL?
- How do you translate a box and line representation of the functions
of a program into code?
- How does the evaluation of a function work? How do parameters work?
- What if a function has no arguments? What can you say about a function
with no arguments with respect to our (strict) definition of functional
programming?
- What does DEFUN do (in a general sense)?
- When should I quote a symbol and when should I not?
- When I pass a list as an argument to a function, how do I quote it?
What if the list has sublists?
- What are the various equality predicates and when should they be
used?
- Why aren't conditionals functions? If they were, what would happen?
- When should I use just T as a test in a conditional?
- How does COND work? What are some likely mistakes that
can happen with COND constructs?
- Why are AND and OR conditionals? How can they be used
as conditionals?
- Could you write a DEFUN that defined IF by using
COND in the body of the function? Why or why not?
If you think you can, beware, "there be dragons here.."
- How can use Lisp (and lists) to create an Abstract Data Type?
- How do I use a list plus some functions to represent the following
data types: an array, a set, a mobile, a dictionary?
- How do keyword arguments work? What are the good for?
- Chapter 6 of Touretzky has lots of good example code with respect
to data structures in Lisp.
- What are recursion templates? How do you recognize each one?
- What is tree recursion? Why is it called CAR/CDR recursion?
If you had a tree data structure, how would you translate that into
a list? (Make sure you understand how my FLATTEN function works.)
- What is tail recursion? Why is it a good idea? How do you recognize
a tail recursive function (or a not tail recursive function )?
- What's a linear recursive process? What's a a linear iterative process?
Why are these not "linear recursive function" and "linear
iterative function"?
- Whats the order of growth in space of a each of the processes above?
So what's the problem ?
- How do a change a non tail recursive function into a tail-recursive
one? (Give the general strategy and make sure you understand some examples.)
- Why (in what cases) can a Lisp interpreter change a linear recursive
process into a linear iterative process by modifying a function?
Why does it want to do this? (This is a rehash of some of the above from
the point of view of the interpreter.)
- How do APPLY and FUNCALL work? When should each
one be used?
- Why doesn't this work:
(defun bogus (some-function-of-one-argument)
(some-function-of-one-argument '(a b c)))
If you think it should work, yeah, it really should but Lisp
just doesn't do it that way....
- What's an applicative operator? What are some examples you know?
- Why does an application operator define a class of functions not
just one function?
- How does MAPCAR work? How do you use MAPCAR with
functions of more than one argument?
- What's a "lambda expression?" How would use it with MAPCAR or
other applicative operators? Why are they a nice convenience?
- What does the function FUNCTION do? What's its abbreviation?
- What's a lexical closure? Why is it a good idea? How could you
get screwed if you didn't have a lexical closure (lexical scoping) and
did have dynamic scoping? When you pass functions as data, how do their
symbols get bound to values?
- Why are functions and data the same thing in Lisp?
Back To The CS2360 Home Page
Ian Smith (iansmith@cc.gatech.edu)
Last Modified 24 Jan 95 by Ian Smith (iansmith@cc.gatech.edu)