equal
deleted
inserted
replaced
15 |
15 |
16 For the coursework in this module you are free to use any programming |
16 For the coursework in this module you are free to use any programming |
17 language you like, but I will show you all my code using Scala---I |
17 language you like, but I will show you all my code using Scala---I |
18 hope you have fond memories of Scala from PEP. The only difference |
18 hope you have fond memories of Scala from PEP. The only difference |
19 with PEP is that I will use the current |
19 with PEP is that I will use the current |
20 stable version of Scala, which at teh time of writing is Scala 3.3.1. |
20 stable version of Scala, which at the time of writing is Scala 3.3.1. |
21 |
21 |
22 \begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
22 \begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
23 If you intend to submit your code for the CW in Scala, you \underline{MUST} submit code that |
23 If you intend to submit your code for the CW in Scala, you \underline{MUST} submit code that |
24 is compatible with Scala 3!! This is to make it easier for me to test |
24 is compatible with Scala 3!! This is to make it easier for me to test |
25 your code and the changes between Scala 2 from last year PEP to Scala |
25 your code and the changes between Scala 2 from last year PEP to Scala |
70 $ curl -L https://github.com/com-lihaoyi/Ammonite/releases/\ |
70 $ curl -L https://github.com/com-lihaoyi/Ammonite/releases/\ |
71 download/2.5.9/3.2-2.5.9 --output amm |
71 download/2.5.9/3.2-2.5.9 --output amm |
72 \end{lstlisting} %% $ |
72 \end{lstlisting} %% $ |
73 |
73 |
74 \noindent |
74 \noindent |
|
75 This creates a file \code{amm} which before it can be run might |
|
76 need some adjustments of the permissions. |
75 The big advantage of Ammonite is that it comes with some additional |
77 The big advantage of Ammonite is that it comes with some additional |
76 libraries already built-in and also allows one to easily break up code |
78 libraries already built-in and also allows one to easily break up code |
77 into smaller modules. For example reading and writing files in |
79 into smaller modules. For example reading and writing files in |
78 Ammonite can be achieved with |
80 Ammonite can be achieved with |
79 |
81 |
148 \end{lstlisting} %% $ |
150 \end{lstlisting} %% $ |
149 |
151 |
150 \noindent Of course this requires that you use \texttt{println} for |
152 \noindent Of course this requires that you use \texttt{println} for |
151 inspecting any data as otherwise nothing will be displayed at the |
153 inspecting any data as otherwise nothing will be displayed at the |
152 commandline. |
154 commandline. |
153 \bigskip |
155 \smallskip |
154 |
156 |
155 \noindent |
157 \noindent |
156 To sum up, Ammonite is a really useful addition to the Scala ecosystem. |
158 To sum up, Ammonite is a really useful addition to the Scala ecosystem. |
157 You can find more information about how to use it in the first five chapters |
159 You can find more information about how to use it in the first five chapters |
158 of the ``Hands-on Scala'' book by Li Haoyi. These chapters are |
160 of the ``Hands-on Scala'' book by Li Haoyi. These chapters are |
159 free and can be used as a reference, see: |
161 free and can be used as a reference, see \url{https://www.handsonscala.com/part-i-introduction-to-scala.html} |
160 |
162 |
161 \begin{center} |
|
162 \url{https://www.handsonscala.com/part-i-introduction-to-scala.html} |
|
163 \end{center} |
|
164 |
163 |
165 \end{document} |
164 \end{document} |
166 |
165 |
167 %%% Local Variables: |
166 %%% Local Variables: |
168 %%% mode: latex |
167 %%% mode: latex |