handouts/ho02.tex
changeset 217 cd6066f1056a
parent 140 1be892087df2
child 251 5b5a68df6d16
equal deleted inserted replaced
216:f5ec7c597c5b 217:cd6066f1056a
     1 \documentclass{article}
     1 \documentclass{article}
     2 \usepackage{charter}
       
     3 \usepackage{hyperref}
     2 \usepackage{hyperref}
     4 \usepackage{amssymb}
     3 \usepackage{amssymb}
     5 \usepackage{amsmath}
     4 \usepackage{amsmath}
     6 \usepackage[T1]{fontenc}
     5 \usepackage[T1]{fontenc}
     7 \usepackage{listings}
     6 \usepackage{../langs}
     8 \usepackage{xcolor}
       
     9 
     7 
    10 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}%
     8 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}%
    11 
     9 
    12 \definecolor{javared}{rgb}{0.6,0,0} % for strings
       
    13 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
       
    14 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
       
    15 \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
       
    16 
    10 
    17 \lstdefinelanguage{scala}{
       
    18   morekeywords={abstract,case,catch,class,def,%
       
    19     do,else,extends,false,final,finally,%
       
    20     for,if,implicit,import,match,mixin,%
       
    21     new,null,object,override,package,%
       
    22     private,protected,requires,return,sealed,%
       
    23     super,this,throw,trait,true,try,%
       
    24     type,val,var,while,with,yield},
       
    25   otherkeywords={=>,<-,<\%,<:,>:,\#,@},
       
    26   sensitive=true,
       
    27   morecomment=[l]{//},
       
    28   morecomment=[n]{/*}{*/},
       
    29   morestring=[b]",
       
    30   morestring=[b]',
       
    31   morestring=[b]"""
       
    32 }
       
    33 
       
    34 \lstset{language=Scala,
       
    35 	basicstyle=\ttfamily,
       
    36 	keywordstyle=\color{javapurple}\bfseries,
       
    37 	stringstyle=\color{javagreen},
       
    38 	commentstyle=\color{javagreen},
       
    39 	morecomment=[s][\color{javadocblue}]{/**}{*/},
       
    40 	numbers=left,
       
    41 	numberstyle=\tiny\color{black},
       
    42 	stepnumber=1,
       
    43 	numbersep=10pt,
       
    44 	tabsize=2,
       
    45 	showspaces=false,
       
    46 	showstringspaces=false}
       
    47 	
       
    48 \begin{document}
    11 \begin{document}
    49 
    12 
    50 \section*{Handout 2}
    13 \section*{Handout 2}
    51 
    14 
    52 Having specified what problem our matching algorithm, $match$, is supposed to solve, namely
    15 Having specified what problem our matching algorithm, $match$, is supposed to solve, namely