Skip to content

Commit

Permalink
Добавяне на преамбюл за избягване на бъг с автоматичната компилация
Browse files Browse the repository at this point in the history
  • Loading branch information
triffon committed Dec 4, 2024
1 parent 7acffda commit a65f351
Showing 1 changed file with 38 additions and 28 deletions.
66 changes: 38 additions & 28 deletions 1.4-scheme_lists.tex
Original file line number Diff line number Diff line change
@@ -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 г.}
Expand Down Expand Up @@ -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]
Expand All @@ -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}

Expand Down

0 comments on commit a65f351

Please sign in to comment.