handouts/scala-ho.tex
changeset 430 e0492fe3d10b
parent 405 30dd644ba71a
child 471 9476086849ad
equal deleted inserted replaced
429:7e71c947ec69 430:e0492fe3d10b
    35 If you want to try out Scala yourself, the official Scala compiler can be
    35 If you want to try out Scala yourself, the official Scala compiler can be
    36 downloaded from
    36 downloaded from
    37 
    37 
    38 \begin{quote}
    38 \begin{quote}
    39 \url{http://www.scala-lang.org}
    39 \url{http://www.scala-lang.org}
       
    40 \end{quote}
       
    41 
       
    42 \noindent
       
    43 A ready-mad bundle with the Eclipse IDE is at
       
    44 
       
    45 \begin{quote}
       
    46 \url{http://scala-ide.org/download/sdk.html}
    40 \end{quote}
    47 \end{quote}
    41 
    48 
    42 Why do I use Scala in the AFL module? Actually, you can do
    49 Why do I use Scala in the AFL module? Actually, you can do
    43 \emph{any} part of the coursework in \emph{any} programming
    50 \emph{any} part of the coursework in \emph{any} programming
    44 language you like. I use Scala for showing you code during the
    51 language you like. I use Scala for showing you code during the
   763 
   770 
   764 
   771 
   765 \begin{lstlisting}[ numbers=none]
   772 \begin{lstlisting}[ numbers=none]
   766 import io.Source
   773 import io.Source
   767 val url = """http://www.inf.kcl.ac.uk/staff/urbanc/"""
   774 val url = """http://www.inf.kcl.ac.uk/staff/urbanc/"""
   768 Source.fromURL(url).take(10000).mkString
   775 Source.fromURL(url)("ISO-8859-1").take(10000).mkString
   769 \end{lstlisting}
   776 \end{lstlisting}
   770 
   777 
   771 
   778 
   772 \noindent These three lines return a string containing the
   779 \noindent These three lines return a string containing the
   773 HTML-code of my webpage. It actually already does something
   780 HTML-code of my webpage. It actually already does something