From a65f351df25c8b440fac8ca011d3545db2385947 Mon Sep 17 00:00:00 2001 From: Trifon Trifonov Date: Thu, 5 Dec 2024 01:31:24 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D1=8F=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20=D0=BF=D1=80=D0=B5=D0=B0=D0=BC=D0=B1?= =?UTF-8?q?=D1=8E=D0=BB=20=D0=B7=D0=B0=20=D0=B8=D0=B7=D0=B1=D1=8F=D0=B3?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B5=20=D0=BD=D0=B0=20=D0=B1=D1=8A=D0=B3=20?= =?UTF-8?q?=D1=81=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87?= =?UTF-8?q?=D0=BD=D0=B0=D1=82=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Източник: https://tex.stackexchange.com/a/720346 --- 1.4-scheme_lists.tex | 66 +++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 28 deletions(-) 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}