# HG changeset patch # User Christian Urban # Date 1600681488 -3600 # Node ID d70dd0b57e354a5962fe96f2042d24134654a38c # Parent 194218161b71765e6107eb1ffde7014748129843 updated diff -r 194218161b71 -r d70dd0b57e35 handouts/amm-ho.pdf Binary file handouts/amm-ho.pdf has changed diff -r 194218161b71 -r d70dd0b57e35 handouts/amm-ho.tex --- a/handouts/amm-ho.tex Fri Sep 18 00:34:47 2020 +0100 +++ b/handouts/amm-ho.tex Mon Sep 21 10:44:48 2020 +0100 @@ -45,11 +45,12 @@ \noindent Ammonite uses the same Scala compiler, just adds some useful features on top of it. It is quite main-stream in the Scala community and it should -therefore be very easy for you to install \texttt{amm}. The big -advantage of Ammonite is that it comes with some additional libraries -already built-in and also allows one to easily break up code into -smaller modules. For example reading and writing files in Ammonite can -be achieved with +therefore be very easy for you to install \texttt{amm}. + +The big advantage of Ammonite is that it comes with some additional +libraries already built-in and also allows one to easily break up code +into smaller modules. For example reading and writing files in +Ammonite can be achieved with \begin{lstlisting}[numbers=none,language=Scala] scala> import ammonite.ops._ @@ -61,8 +62,10 @@ \end{lstlisting} \noindent -For loading and accessing code from another Scala file, you can import it -as follows: +The latter writes the string \code{"foo bar"} into the file +\code{"file.name"}, which is located in the current working +directory. For loading and accessing code from another Scala file, you +can import it as follows: \begin{lstlisting}[numbers=none,language=Scala] import $file.name-of-the-file diff -r 194218161b71 -r d70dd0b57e35 progs/matcher/re1.sc --- a/progs/matcher/re1.sc Fri Sep 18 00:34:47 2020 +0100 +++ b/progs/matcher/re1.sc Mon Sep 21 10:44:48 2020 +0100 @@ -17,6 +17,7 @@ case class SEQ(r1: Rexp, r2: Rexp) extends Rexp // sequence case class STAR(r: Rexp) extends Rexp // star + // nullable function: tests whether a regular // expression can recognise the empty string def nullable(r: Rexp) : Boolean = r match {