From: pimjager Date: Thu, 2 Jun 2016 09:27:26 +0000 (+0200) Subject: improved presentation X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=f9729d57c91bd41e8a91f93de4c2c869133b2de2;p=cc1516.git improved presentation --- diff --git a/deliverables/p4/p4.tex b/deliverables/p4/p4.tex index 692fb06..b748f04 100644 --- a/deliverables/p4/p4.tex +++ b/deliverables/p4/p4.tex @@ -27,6 +27,17 @@ \begin{document} \frame{\titlepage} +\begin{frame}[fragile] + \frametitle{Today} + \begin{itemize} + \item Higher order functions + \item Anonymous lambda functions + \item Syntactic sugar + \item Future work + \item Demo + \end{itemize} +\end{frame} + \begin{frame}[fragile] \frametitle{Higher order functions implemented using function pointers} @@ -52,7 +63,7 @@ main() { \end{frame} \begin{frame}[fragile] - \frametitle{Functions application can be curried} + \frametitle{Function application can be curried} \begin{SPLCode} plus(x,y) :: Int -> Int -> Int { @@ -60,7 +71,7 @@ plus(x,y) :: Int -> Int -> Int { } main() { - map(plus(1), 1:2:3:[]); + map(plus(4), 1:2:3:[]); } \end{SPLCode} \pause @@ -130,14 +141,14 @@ main() { \item We want to protect our users from global state (as much as possible). \end{itemize} - \item Global constants allowed through \texttt{Let} statements - \item \texttt{ ::= `Let' `=' `;'} + \item Global constants allowed through \texttt{let} statements + \item \texttt{ ::= `let' `=' `;'} \item Lets are rewritten to constant functions \end{itemize} \begin{columns}[T] \begin{column}[T]{0.4\linewidth} \begin{SPLCode} -Let Int x = 5; +let Int x = 5; \end{SPLCode} \end{column} \begin{column}[T]{0.4\linewidth} @@ -185,13 +196,14 @@ var xs = 1:2:3:[]; \begin{columns}[T] \begin{column}[T]{0.34\linewidth} \begin{SPLCode} -print("x is: ", x); +print("x is: ", x, "\n"); \end{SPLCode} \end{column} \begin{column}[T]{0.5\linewidth} \begin{SPLCode} print("x is: "); print(x); +print("\n"); \end{SPLCode} \end{column} \end{columns}