equal
deleted
inserted
replaced
184 \end{quote} |
184 \end{quote} |
185 |
185 |
186 \noindent\alert |
186 \noindent\alert |
187 For PEP, make sure you are using the version 3(!) of Scala. This is |
187 For PEP, make sure you are using the version 3(!) of Scala. This is |
188 the version I am going to use in the lectures and in the coursework. This |
188 the version I am going to use in the lectures and in the coursework. This |
189 can be any version of Scala 3.X where $X=\{4,5,6,7\}$. Also the minor |
189 can be any version of Scala 3.X where $X=\{3,4,5,6,7\}$. Also the minor |
190 number does not matter. Note that this will be the second year I am |
190 number does not matter. Note that this will be the second year I am |
191 using this newer version of Scala -- some hiccups can still happen. Apologies |
191 using this newer version of Scala -- some hiccups can still happen. Apologies |
192 in advance!\bigskip |
192 in advance!\bigskip |
193 |
193 |
194 %\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
194 %\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
249 \caption{My installation of VS Code / Codium includes the |
249 \caption{My installation of VS Code / Codium includes the |
250 package \textbf{Scala Syntax (official)} 0.5.7 from Marketplace. |
250 package \textbf{Scala Syntax (official)} 0.5.7 from Marketplace. |
251 I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
251 I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
252 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
252 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
253 evaluate small code snippets in the Scala REPL. I use Codium's internal |
253 evaluate small code snippets in the Scala REPL. I use Codium's internal |
254 terminal to run \texttt{scala} version 1.0.5 which |
254 terminal to run \texttt{scala} version 3.7.3.\label{vscode}} |
255 uses Scala 3.7.3.\label{vscode}} |
|
256 \end{boxedminipage} |
255 \end{boxedminipage} |
257 \end{figure} |
256 \end{figure} |
258 |
257 |
259 Actually \alert last year I switched to VS Codium as IDE for writing Scala programs. VS Codium is VS Code |
258 Actually \alert last year I switched to VS Codium as IDE for writing Scala programs. VS Codium is VS Code |
260 minus all the telemetry data that is normally sent to Microsoft. Apart from |
259 minus all the telemetry data that is normally sent to Microsoft. Apart from |
640 |
639 |
641 \subsection*{Standalone Scala Apps} |
640 \subsection*{Standalone Scala Apps} |
642 |
641 |
643 If you want to write a standalone app in Scala, you can |
642 If you want to write a standalone app in Scala, you can |
644 implement a function \texttt{hello} and annotate the tag |
643 implement a function \texttt{hello} and annotate the tag |
645 \texttt{@main}. For example write |
644 \texttt{@main}.\footnote{In Scala 2, one had to write object-hello, this require} For example write |
646 |
645 |
647 \begin{lstlisting}[numbers=none] |
646 \begin{lstlisting}[numbers=none] |
648 @main |
647 @main |
649 def Hello() = println("hello world") |
648 def Hello() = println("hello world") |
650 \end{lstlisting} |
649 \end{lstlisting} |