Skip to content

Commit 52d00b3

Browse files
committed
More on records.
1 parent 2c83378 commit 52d00b3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.tex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,15 @@ \section{Records}
13801380
{re = re, im = -im}
13811381
\end{lstlisting}
13821382
1383+
This convenience is also present in tuple expressions. If we elide the
1384+
definition of a field, the value will be taken from the variable in
1385+
scope with the same name:
1386+
1387+
\begin{lstlisting}
1388+
let conj ({re, im}: complex): complex =
1389+
{re, im = -im}
1390+
\end{lstlisting}
1391+
13831392
\subsection{Tuples as a Special Case of Records}
13841393
13851394
In Futhark, tuples are merely records with numeric labels starting

0 commit comments

Comments
 (0)