--- a/progs/fun/fun.sc Thu Nov 27 18:18:36 2025 +0000
+++ b/progs/fun/fun.sc Thu Dec 04 21:33:25 2025 +0000
@@ -1,3 +1,13 @@
+def even(n: Int) : Boolean = {
+ if (n == 0) true else odd(n - 1)
+}
+def odd(n: Int) : Boolean = {
+ if (n == 0) false else even(n - 1)
+}
+
+
+
+
// A Small Compiler for a Simple Functional Language
// (includes a parser and lexer)
//
@@ -16,9 +26,7 @@
// amm fun.sc run fact.fun
//
// the first prints out the JVM instructions for two
-// factorial functions
-//
-// the next compile/run fun files
+// factorial functions; the next compiles/runs fun files
//
import $file.fun_tokens, fun_tokens._
Binary file slides/basic-code.jpg has changed
Binary file slides/machine-code-large.png has changed
Binary file slides/machine-code.jpg has changed
Binary file slides/slides08.pdf has changed
--- a/slides/slides08.tex Thu Nov 27 18:18:36 2025 +0000
+++ b/slides/slides08.tex Thu Dec 04 21:33:25 2025 +0000
@@ -158,37 +158,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[t,fragile]
-
-\small
-\begin{textblock}{13}(-0.5,1)
-\begin{lstlisting}[numbers=none]
-def mkeps(r: Rexp) : Val = r match {
- ...
- case PLUS(r) => Stars(List(mkeps(r)))
- case OPTIONAL(r) => Stars(Nil)
- case NTIMES(r, n) => Stars(List.fill(n)(mkeps(r)))
-}
-
-def inj(r: Rexp, c: Char, v: Val) : Val = (r, v) match {
- ...
- case (RANGE(_), Empty) => Chr(c)
- case (PLUS(r), Sequ(v1, Stars(vs))) => Stars(inj(r, c, v1)::vs)
- case (OPTIONAL(r), v) => Stars(inj(r, c, v)::Nil)
- case (NTIMES(r, n), Sequ(v1, Stars(vs))) => Stars(inj(r, c, v1)::vs)
-}
-\end{lstlisting}
-\end{textblock}
-
-
-\begin{textblock}{5}(3,13.5)
-\bl{$r^? \dn r^{\{0..1\}}$}
-\end{textblock}
-
-\end{frame}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Binary file slides/slides09.pdf has changed
--- a/slides/slides09.tex Thu Nov 27 18:18:36 2025 +0000
+++ b/slides/slides09.tex Thu Dec 04 21:33:25 2025 +0000
@@ -46,10 +46,10 @@
\begin{center}
\begin{tabular}{ll}
Email: & christian.urban at kcl.ac.uk\\
-Office Hour: & Fridays 12 -- 14\\
+Office Hour: & Fridays 11:30 -- 12:30\\
Location: & N7.07 (North Wing, Bush House)\\
Slides \& Progs: & KEATS\\
- Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\
+ %%Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\
\end{tabular}
\end{center}