diff --git a/1.4-scheme_lists.tex b/1.4-scheme_lists.tex index ab50a8a..dcf5bbe 100644 --- a/1.4-scheme_lists.tex +++ b/1.4-scheme_lists.tex @@ -1,6 +1,16 @@ \documentclass[alsotrans,beameroptions={aspectratio=169}]{beamerswitch} \usepackage{fprog} +\ExplSyntaxOn +\cs_set:Npn \tbl_crcr:n #1 { + \int_compare:nNnT \g__tbl_col_int > 0 + { + \tbl_count_missing_cells:n {#1} + } + \crcr + } +\ExplSyntaxOff + \title{Списъци} \date{16--23 октомври 2024 г.} @@ -473,33 +483,33 @@ \section{Функции от по-висок ред за списъци} В Racket са дефинирани функциите \tt{map}, \tt{filter}, \tt{foldr}, \tt{foldl}\\[2ex] \pause \alert{Внимание: \tt{foldl} в Racket е дефинирана по различен начин!}\\[2ex] - \begin{columns}[T,onlytextwidth] - \small - \begin{column}{.5\textwidth} - \tt{foldl} от лекции\\[2ex] -\begin{lstlisting} -(define (foldl op nv l) - (if (null? l) nv - (foldl op @\alert{(op nv (car l))}@ - (cdr l)))) -\end{lstlisting} - \begin{equation*} - \Big(\ldots\big((\bot \oplus a_1) \oplus a_2\big) \oplus \ldots\Big) \oplus a_n - \end{equation*} - \end{column} - \begin{column}{.5\textwidth} - \tt{foldl} в Racket\\[2ex] -\begin{lstlisting} -(define (foldl op nv l) - (if (null? l) nv - (foldl op @\alert{(op (car l) nv)}@ - (cdr l)))) -\end{lstlisting} - \begin{equation*} - a_n \oplus \Big(\ldots \big(a_2 \oplus (a_1 \oplus \bot)\big)\ldots\Big), - \end{equation*} - \end{column} - \end{columns} +% \begin{columns}[T,onlytextwidth] +% \small +% \begin{column}{.5\textwidth} +% \tt{foldl} от лекции\\[2ex] +% \begin{lstlisting} +% (define (foldl op nv l) +% (if (null? l) nv +% (foldl op @\alert{(op nv (car l))}@ +% (cdr l)))) +% \end{lstlisting} +% \begin{equation*} +% \Big(\ldots\big((\bot \oplus a_1) \oplus a_2\big) \oplus \ldots\Big) \oplus a_n +% \end{equation*} +% \end{column} +% \begin{column}{.5\textwidth} +% \tt{foldl} в Racket\\[2ex] +% \begin{lstlisting} +% (define (foldl op nv l) +% (if (null? l) nv +% (foldl op @\alert{(op (car l) nv)}@ +% (cdr l)))) +% \end{lstlisting} +% \begin{equation*} +% a_n \oplus \Big(\ldots \big(a_2 \oplus (a_1 \oplus \bot)\big)\ldots\Big), +% \end{equation*} +% \end{column} +% \end{columns} \end{frame} \begin{frame}[fragile] @@ -526,7 +536,7 @@ \section{Функции от по-висок ред за списъци} \begin{lstlisting} (define (foldl1 op l) (foldl op (car l) (cdr l))) -\end{lstlisting} +\end{lstlisting}\\ \end{tabular} \end{frame}