Skip to content

Commit

Permalink
More on records.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Nov 13, 2017
1 parent 2c83378 commit 52d00b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,15 @@ \section{Records}
{re = re, im = -im}
\end{lstlisting}
This convenience is also present in tuple expressions. If we elide the
definition of a field, the value will be taken from the variable in
scope with the same name:
\begin{lstlisting}
let conj ({re, im}: complex): complex =
{re, im = -im}
\end{lstlisting}
\subsection{Tuples as a Special Case of Records}
In Futhark, tuples are merely records with numeric labels starting
Expand Down

0 comments on commit 52d00b3

Please sign in to comment.