\batchmode










\documentstyle[11pt,psfig,epsf,landscape,twoside,color]{article}
\makeatletter

\pagestyle{myheadings}

%
\evensidemargin 35pt

%
\setcounter{secnumdepth}{0}

%

\setlength{\oddsidemargin}{0in}
%
\setlength{\textwidth}{6.5in}

%


\setlength{\topmargin}{-0.5in}
%
\setlength{\headheight}{0.25in}
%
\setlength{\headsep}{0.25in}
%
\setlength{\textheight}{8.5in}

%

\setlength{\parindent}{0in}

%
\setlength{\parskip}{\medskipamount}

%



%



%


%






%

\newlength{\hlessmm}
\setlength{\hlessmm}{\textwidth}
\addtolength{\hlessmm}{-2em}

\newlength{\hlessmmmm}
\setlength{\hlessmmmm}{\textwidth}
\addtolength{\hlessmmmm}{-4em}

%



%



%





%









\outer

\outer

\outer

{\obeyspaces\gdef {\ }}

%



 

%
\newlength{\illuswidth}
\setlength{\illuswidth}{\textwidth}
\addtolength{\illuswidth}{-7pt}

%


%



%


%



%


%








%














\setlength{\textheight}{9in}
\setlength{\textwidth}{6.7in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{-0.2in}

\definecolor{HiddenAnswer}{rgb}{1,1,1}
\definecolor{HighlitedAnswer}{rgb}{1,0,0}
\definecolor{EndOfAnswer}{rgb}{0,0,0}

%







%




\def\AnswerSheet{1}

\newcommand {\evalsto}{$\Longrightarrow$}

\newcommand {\hstrut}[1]{\hspace*{#1}}

\newcommand {\vstrut}[2]{\rule[#1]{0in}{#2}}

\newcommand {\hm}{\hspace*{1em}}

\newcommand {\hmm}{\hspace*{2em}}

\newcommand {\hmmm}{\hspace*{3em}}

\newcommand {\hmmmm}{\hspace*{4em}}

\newenvironment {tightlist}%
{\begin{list}{$\bullet$}{%
    \setlength{\topsep}{0in}
    \setlength{\partopsep}{0in}
    \setlength{\itemsep}{0in}
    \setlength{\parsep}{0in}
    \setlength{\leftmargin}{1.5em}
    \setlength{\rightmargin}{0in}
    \setlength{\itemindent}{0in}
}
}%
{\end{list}
}

\newcommand {\cf}{\footnotesize\tt}

\newcommand {\IP}{$\bullet$}

\newcommand {\RA}{{\Large \bf $\Rightarrow$}}

\newcommand {\goesto}{$\longrightarrow$}

\def\lisp#1{\footnotesize\tt #1}

\def\beginlispA{%
  \begin{minipage}[t]{\linewidth}
  \begin{list}{$\bullet$}{%
    \setlength{\topsep}{0in}
    \setlength{\partopsep}{0in}
    \setlength{\itemsep}{0in}
    \setlength{\parsep}{0in}
    \setlength{\leftmargin}{0in}
    \setlength{\rightmargin}{0in}
    \setlength{\itemindent}{0in}
  }\item[]
  \obeyspaces
  \obeylines \footnotesize\tt}

\def\beginlisp{%
  \begin{minipage}[t]{\linewidth}
  \begin{list}{$\bullet$}{%
    \setlength{\topsep}{0in}
    \setlength{\partopsep}{0in}
    \setlength{\itemsep}{0in}
    \setlength{\parsep}{0in}
    \setlength{\leftmargin}{1.5em}
    \setlength{\rightmargin}{0in}
    \setlength{\itemindent}{0in}
  }\item[]
  \obeyspaces
  \obeylines \footnotesize\tt}

\def\endlisp{%
  \end{list}
  \end{minipage}
  }

\def\psfileprefix{/usr/nikhil/parle/}

\def\illustration#1#2{
\vbox to #2{\vfill\special{psfile=\psfileprefix#1.ps hoffset=-72 voffset=-45}}}

\newcommand {\closure}[2]{%
\begin{tabular}[t]{l}
\raisebox{-1.5ex}{%
  \setlength{\unitlength}{0.2ex}
  \begin{picture}(25,15)(0,-7)
   \put( 5,5){\circle{10}}
   \put( 5,5){\circle*{1}}
   \put( 5,5){\vector(0,-1){10}}
   \put(15,5){\circle{10}}
   \put(15,5){\circle*{1}}
   \put(15,5){\vector(1,0){12}}
  \end{picture}}
  \fbox{\footnotesize #2} \\ 
%
\hspace*{0.8ex} \fbox{\footnotesize #1}
\end{tabular}
}

\newcommand {\proc}[2]{%
\begin{tabular}{l}
params: #1 \\ 
body: #2 \\ 
\end{tabular}
}

\newcommand {\psetheader}[2]{%
\markboth{6.001, #1---#2}{6.001, #1---#2}
\begin{center}
MASSACHVSETTS INSTITVTE OF TECHNOLOGY \\ 
Department of Electrical Engineering and Computer Science \\ 
6.001---Structure and Interpretation of Computer Programs \\ 
#1 \\ 
\medskip
{\bf #2}
\end{center}
}

\newcommand {\problem}[1]{{\bf #1}}

\newcommand {\key}[1]{\fbox{{\sc #1}}}

\newcommand {\ctrl}{\key{ctrl}--}

\newcommand {\shift}{\key{shift}--}

\newcommand {\run}{\key{run} \ }

\newcommand {\runkey}[1]{\run \key{#1}}

\newcommand {\extend}{\key{extend} \ }

\newcommand {\kkey}[1]{\key{k$_{#1}$}}

\def\fbox#1{%
  \vtop{\vbox{\hrule%
              \hbox{\vrule\kern3pt%
                    \vtop{\vbox{\kern3pt#1}\kern3pt}%
                    \kern3pt\vrule}}%
        \hrule}}

\def\emptybox#1#2{\fbox{\vbox to #2{\hbox to #1 {\null}}}}

\def\pscenter#1{\hbox to\hsize{\hss\psadobenomag{#1}\hss}}

\def\itemx{\vspace{-0.1in}\item}

\def\ANSWER#1{{\color{HiddenAnswer} #1 \color{EndOfAnswer}}}

\makeatother
\newenvironment{tex2html_wrap}{}{}
\newwrite\lthtmlwrite
\def\lthtmltypeout#1{{\let\protect\string\immediate\write\lthtmlwrite{#1}}}%
\newbox\sizebox
\begin{document}
\pagestyle{empty}
\setcounter{secnumdepth}{0}
{\newpage
\clearpage
\samepage \begin{tabular}{p{3in}p{3in}}
{

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
$\Rightarrow$ (define four 4)
{\color{HiddenAnswer} ;Value: "four --> 4" \color{EndOfAnswer}}
$\Rightarrow$ four
{\color{HiddenAnswer} ;Value: 4 \color{EndOfAnswer}}
$\Rightarrow$ (define six (lambda () 6))
{\color{HiddenAnswer} ;Value: "six --> \#[compound procedure]" \color{EndOfAnswer}}
$\Rightarrow$ six
{\color{HiddenAnswer} ;Value: \#[compound procedure] \color{EndOfAnswer}}
$\Rightarrow$ (+ four 1)
{\color{HiddenAnswer} ;Value: 5 \color{EndOfAnswer}}
$\Rightarrow$ (+ (four) 1)
{\color{HiddenAnswer} ;Error: The object 4 is not applicable \color{EndOfAnswer}}
$\Rightarrow$ (+ six 1)
{\color{HiddenAnswer} ;Error: Compound procedure passed to add \color{EndOfAnswer}}
$\Rightarrow$ (+ (six) 1)
{\color{HiddenAnswer} ;Value: 7 \color{EndOfAnswer}}
$\Rightarrow$ (define f-add 
     (lambda (x y) 
        (+ (x) (y))))
{\color{HiddenAnswer} ;Value: "f-add --> \#[compound procedure]" \color{EndOfAnswer}}
$\Rightarrow$ (f-add six (lambda () four))
{\color{HiddenAnswer} ;Value: 10 \color{EndOfAnswer}}

\end{list}
\end{minipage} 
} & {

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
$\Rightarrow$ (define a 5)
{\color{HiddenAnswer} ;Value: "a --> 5" \color{EndOfAnswer}}
$\Rightarrow$ (define b (+ 1 a))
{\color{HiddenAnswer} ;Value: "b --> 6" \color{EndOfAnswer}}
$\Rightarrow$ (+ 2 (if (> b a) b a))
{\color{HiddenAnswer} ;Value: 8 \color{EndOfAnswer}}
$\Rightarrow$ (if \#t 5 (/ 1 0))
{\color{HiddenAnswer} ;Value: 5 \color{EndOfAnswer}}
$\Rightarrow$ ((if (< a b) + -) a b)
{\color{HiddenAnswer} ;Value: 11 \color{EndOfAnswer}}
$\Rightarrow$ (if (if + \#f 2) 3 6)
{\color{HiddenAnswer} ;Value: 6 \color{EndOfAnswer}}
$\Rightarrow$ (if 0 1 2)
{\color{HiddenAnswer} ;Value: 1 \color{EndOfAnswer}}
$\Rightarrow$ (define n 4)
{\color{HiddenAnswer} ;Value: "n --> 4" \color{EndOfAnswer}}
$\Rightarrow$ (define increment (lambda (x) (+ x 1)))
{\color{HiddenAnswer} ;Value: "increment --> \#[compound proc]" \color{EndOfAnswer}}
$\Rightarrow$ (increment n)
{\color{HiddenAnswer} ;Value: 5 \color{EndOfAnswer}}
$\Rightarrow$ n
{\color{HiddenAnswer} ;Value: 4 \color{EndOfAnswer}}

\end{list}
\end{minipage} 
}
\end{tabular}
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline781: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline789: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline791: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline793: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline795: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline797: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline799: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\lambda$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline801: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline803: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\lambda$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline805: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline807: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline809: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline811: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\Rightarrow$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline813: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

{\newpage
\clearpage
\samepage \begin{tabular}{p{2.7in}p{0.5in}p{3in}}
{

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(define <proc> 
  (lambda (<arg1> <arg2> ... <argn>)
     <body>))

\end{list}
\end{minipage} 
} & {\LARGE $\Leftarrow\Rightarrow$} &
{

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(define (<proc> <arg1> <arg2> ... <argn>)
     <body>)

\end{list}
\end{minipage} 
} \\ 
For example, instead of writing: & & we can write: \\ 
{

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(define average 
  (lambda (x y) 
    (/ (+ x y) 2)))

\end{list}
\end{minipage} 
} & {\LARGE $\Leftarrow\Rightarrow$} & {

\begin{minipage}[t]{\linewidth}
\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{1.5em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(define (average x y) 
    (/ (+ x y) 2))

\end{list}
\end{minipage} 
}
\end{tabular}
}

{\newpage
\clearpage
\samepage \begin{tabular}{ll}
$n! = 1$  & for $n = 0$ \\ 
$n! = n (n-1)!$ & for $n > 0$ \\ 
\end{tabular}
}

{\newpage
\clearpage
\samepage \setbox\sizebox=\hbox{$\bullet$}\lthtmltypeout{latex2htmlSize :tex2html_wrap_inline835: \the\ht\sizebox::\the\dp\sizebox.}\box\sizebox
}

\stepcounter{section}

\end{document}
