# HG changeset patch # User Christian Urban # Date 1600690562 -3600 # Node ID d41956ea544eea5aa943303728c654f976ff92a7 # Parent d70dd0b57e354a5962fe96f2042d24134654a38c updated diff -r d70dd0b57e35 -r d41956ea544e handouts/amm-ho.pdf Binary file handouts/amm-ho.pdf has changed diff -r d70dd0b57e35 -r d41956ea544e handouts/amm-ho.tex --- a/handouts/amm-ho.tex Mon Sep 21 10:44:48 2020 +0100 +++ b/handouts/amm-ho.tex Mon Sep 21 13:16:02 2020 +0100 @@ -77,7 +77,7 @@ \texttt{name-of-the-file.sc} and requires the file to be in the same directory where \texttt{amm} is working in. This will be very convenient for the compiler we implement in CFL, because it allows us to easily -break-up the code into the lexer, parser and code generator. +break up the code into the lexer, parser and code generator. Another feature which exists in Ammonite, but not yet in the current version of Scala (it will be in the next version called dotty) @@ -114,7 +114,20 @@ \noindent What is also good in Ammonite that you can specify more than one function to be ``main'' and then specify on the command line which -function do you want to run as entry-point.\bigskip +function you want to run as entry-point. + +Another feature you might like to use is that Ammonite can ``watch'' files. +This means it can automatically re-run a file when it is saved. For this +you have to call \texttt{amm} with the option \texttt{-w}, as in + +\begin{lstlisting}[numbers=none,language=Scala] +$ amm -w file.sc +\end{lstlisting} %% $ + +\noindent Of course this requires that you use \texttt{println} for +inspecting any data, as otherwise nothing will be displayed at the +commandline. +\bigskip \noindent To sum up, Ammonite is a really useful addition to the Scala ecosystem.