Class 5


Tools for the Day

Latex for transparencies
I added an example of a Tex file that can be used to make transparencies. You can also just use the "\Huge" format, but the macros for slides are helpful in other ways as well.

Mathematica
Today I want to illustrate some "simple" uses of Mathematica, comparing the line-oriented and notebook front ends.

Status of Projects


A Closer Look at Functional Programming and Recursion

Review from last time.
Recursive programs avoid the need for local variables and extra state information. The ideas of functional programming, including function mapping and lambda functions, and powerful and often not appreciated.

Although recursion can be very inefficient, tail recursion, when recognized by the compiler, makes this approach as efficient as iteration.

Key topics from last time include

The richness of lists.
Because lists can contain others lists as elements, a list can represent more than a simple linear array. We will look a its use for representing a tree.

Review of recursion and its use with lists.
There is a simple "structure" used when writing programs that traverse lists. We'll review this today.

Tail recursion.
Tail recursion makes recursive programs as fast as traditional iterative programs while preserving the recursive structure, once you see how to do it.

Lisp script for today's class.
class5.lsp


Next time

We continue with general Lisp programming, sinking into iteration, simple macros, and indexing.