\batchmode






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

\pagestyle{myheadings}

%
\evensidemargin 35pt

%


%

\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
%
\setlength{\textwidth}{7in}

%


\setlength{\topmargin}{-0.5in}
%
\setlength{\textheight}{9in}

%

\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

\outer

{\obeyspaces\gdef {\ }}

\outer

\outer


%



 

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

%


%



%


%



%


%








%

















%



%


\pagestyle{empty}


\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}{\tt}

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

\newcommand {\RA}{$\Rightarrow$}

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

\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\beginlispshort{%
  \begin{minipage}[t]{2.5in}
  \begin{list}{$\bullet$}{%
    \setlength{\topsep}{0in}
    \setlength{\partopsep}{0in}
    \setlength{\itemsep}{0in}
    \setlength{\parsep}{0in}
    \setlength{\leftmargin}{0em}
    \setlength{\rightmargin}{0in}
    \setlength{\itemindent}{0in}
  }\item[]
  \obeyspaces
  \obeylines \tt}

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

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

\def\el{%
  \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\bpbox{\parbox{2pc}{\vrule\hrule\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{{\cf\color{red} #1}}

\makeatother
\newenvironment{tex2html_wrap}{}{}
\newwrite\lthtmlwrite
\def\lthtmltypeout#1{{\let\protect\string\immediate\write\lthtmlwrite{#1}}}%
\newbox\sizebox
\begin{document}
\pagestyle{empty}
\stepcounter{section}
{\newpage
\clearpage
\samepage \begin{tabular}[t]{|p{3in}|p{3in}|}\hline

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
'(a b)
$\Rightarrow$  {\tt \color{red} (a b)}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-4.eps,height=.5in,silent=,clip=}}
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
(cons 'a '(b)) 
$\Rightarrow$  {\tt \color{red} (a b)}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-1.eps,height=.5in,silent=,clip=}}
\\  \hline

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
(list 'a 'b)
$\Rightarrow$  {\tt \color{red} (a b)}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-5.eps,height=.5in,silent=,clip=}}
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
(quote (testing one two))
$\Rightarrow$  {\tt \color{red} (testing one two)}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-6.eps,height=.5in,silent=,clip=}}
\\  \hline

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
(list '(a) '(b))
$\Rightarrow$  {\tt \color{red} ((a) (b))}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-2.eps,height=.75in,silent=,clip=}}
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
\vspace{.5pc}
(cons '(a) '(b))
$\Rightarrow$  {\tt \color{red} ((a) b)}

\end{list}\end{minipage} 
\centerline{\psfig{file=r10-3.eps,height=.75in,silent=,clip=}}
\\  \hline
\end{tabular}
}

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

{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{2in}p{2in}p{2.5in}}
(define a 3)&
(define p (list cons +))&
(define x '(a b))\\ 
(define b 4)&
(define q '(cons +))&
(define alpha '(a Greek letter))\\ 
(define c (list 5 6))&
(define r (list 'cons '+))&
(define beta '(I don't know))\\ 
\end{tabular}
}

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

{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{2in}p{2in}p{2.5in}}
(list 'a b)
$\Rightarrow$  {\tt \color{red} (a 4)}
& 
(car x)
$\Rightarrow$  {\tt \color{red} a}
&
((car r) 3 4)
$\Rightarrow$  {\tt \color{red} Error -- can't apply a symbol}
\\ 
'(a b)
$\Rightarrow$  {\tt \color{red} (a b)}
&
(cdr alpha)
$\Rightarrow$  {\tt \color{red} (Greek letter)}
&
((cadr q) 3 4)
$\Rightarrow$  {\tt \color{red} Error -- can't apply a symbol}
\\ 
(cons b x)
$\Rightarrow$  {\tt \color{red} (4 a b)}
& 
((car p) 3 4)
$\Rightarrow$  {\tt \color{red} (3 . 4)}
&
(car ''a)
$\Rightarrow$  {\tt \color{red} quote}
\\ 
(list 'b c)
$\Rightarrow$  {\tt \color{red} (b (5 6))}
&
((cadr p) 3 4)
$\Rightarrow$  {\tt \color{red} 7}
& 
beta
$\Rightarrow$  {\tt \color{red} (I don (quote t) know)}
\\ 
\end{tabular}
}

\stepcounter{section}
{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{2in}p{2in}}

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(eq? 'apples 'apples)
$\Rightarrow$  \#t

\end{list}\end{minipage} 
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(eq? 'apples 'oranges)
$\Rightarrow$  \#f

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

{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{2in}p{2in}}

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(eq? 1 1)
$\Rightarrow$  unspecified
\vspace{1pc}

\end{list}\end{minipage} 
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(let ((x (+ 1 2)))
  (eq? x x))
$\Rightarrow$  unspecified

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

\stepcounter{section}
{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{7in}}

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(define (memq item lst)
{\tt \color{red} 
  (cond ((null? lst) false)
        ((eq? item (car lst)) lst)
        (else (memq item (cdr lst)))))
}

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

{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{3in}p{3in}}

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(memq 'robots '(building robots is fun))
$\Rightarrow$  {\tt \color{red} (robots is fun)}
(memq 'robot '(building robots is fun))
$\Rightarrow$  {\tt \color{red} false}

\end{list}\end{minipage} 
&

\begin{minipage}[c]{\linewidth}\begin{list}{$\bullet$}{%
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\itemsep}{0in}
\setlength{\parsep}{0in}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0in}
\setlength{\itemindent}{0in}
}\item[]
\obeyspaces
\obeylines \footnotesize\tt 
(memq 'bolts '(screws (bolts washers) nails))
$\Rightarrow$  {\tt \color{red} false}
(memq 'bolts '(screws (bolts washers) nails bolts pins))
$\Rightarrow$  {\tt \color{red} (bolts pins)}

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

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

{\newpage
\clearpage
\samepage \begin{tabular}[t]{p{8in}}
{\tt \color{red} 
((lambda (x)
   (list x (list (quote quote) x)))
 (quote (lambda (x)
          (list x (list (quote quote) x)))))
}
\end{tabular}
}

\stepcounter{section}
\stepcounter{section}

\end{document}
