Pārlūkot izejas kodu

Cosmetics

stripped-german
Julian Ospald pirms 9 gadiem
vecāks
revīzija
4debb98557
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 220CD1C5BDEED020
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      VL1.tex

+ 1
- 1
VL1.tex Parādīt failu

@@ -342,7 +342,7 @@ mod2 x
| x - 2 < 0 = x
| otherwise = mod2 (x - 2)
\end{lstlisting}
These \verb#|# things above are called \textbf{guards} and are similar to \emph{pattern matching}. They are processed in order. If the condition on the left side of the equation is true, then it returns what stands on the right side of the equation. If it's false, then it processes the next line.\\ \emph{"otherwise"} on the last line is just defined as \emph{True}, to make these constructs reasier to read and catch all other cases of input.
These \verb#|# things above are called \textbf{guards} and are similar to \emph{pattern matching}. They are processed in order. If the condition on the left side of the equation is true, then it returns what stands on the right side of the equation. If it's false, then it processes the next line.\\ \code{otherwise} on the last line is just defined as \code{True}, to make these constructs reasier to read and catch all other cases of input.
\end{frame}

\begin{frame}[fragile]


Notiek ielāde…
Atcelt
Saglabāt