equal
deleted
inserted
replaced
6 %cheat sheet |
6 %cheat sheet |
7 %http://worldline.github.io/scala-cheatsheet/ |
7 %http://worldline.github.io/scala-cheatsheet/ |
8 |
8 |
9 \begin{document} |
9 \begin{document} |
10 |
10 |
11 \section*{A Crash-Course on Scala} |
11 \section*{A Crash-Course in Scala} |
12 |
12 |
13 \subsection*{The Very Basics} |
13 \subsection*{The Very Basics} |
14 |
14 |
15 One advantage of Scala over Java is that it includes an interpreter (a |
15 One advantage of Scala over Java is that it includes an interpreter (a |
16 REPL, or |
16 REPL, or |
38 res0: Int = 5 |
38 res0: Int = 5 |
39 \end{lstlisting} |
39 \end{lstlisting} |
40 |
40 |
41 \noindent indicating that the result of the addition is of type |
41 \noindent indicating that the result of the addition is of type |
42 \code{Int} and the actual result is 5; \code{res0} is a name that |
42 \code{Int} and the actual result is 5; \code{res0} is a name that |
43 Scala gives automatically to the result. Yoy can reuse this name later |
43 Scala gives automatically to the result. You can reuse this name later |
44 on. Another classic example you can try out is |
44 on. Another classic example you can try out is |
45 |
45 |
46 \begin{lstlisting}[numbers=none] |
46 \begin{lstlisting}[numbers=none] |
47 scala> print("hello world") |
47 scala> print("hello world") |
48 hello world |
48 hello world |