Move emptyList to the top
This commit is contained in:
4
VL1.tex
4
VL1.tex
@@ -366,12 +366,12 @@ list1 = [1, 2]
|
|||||||
\pause
|
\pause
|
||||||
or by using the \emph{cons} operator \code{(:)} which takes an element and a list and produces a new list with the element prepended to the front.
|
or by using the \emph{cons} operator \code{(:)} which takes an element and a list and produces a new list with the element prepended to the front.
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
|
emptyList = []
|
||||||
|
|
||||||
list2 = 1 : []
|
list2 = 1 : []
|
||||||
|
|
||||||
-- is this really a list?
|
-- is this really a list?
|
||||||
list3 = [1, 2] == 1 : 2 : []
|
list3 = [1, 2] == 1 : 2 : []
|
||||||
|
|
||||||
emptyList = []
|
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\pause
|
\pause
|
||||||
How about something more interesting:
|
How about something more interesting:
|
||||||
|
|||||||
Reference in New Issue
Block a user