Skip to content

Commit f0d0cbf

Browse files
author
Bryan Dunsmore
committed
Include definition of tuples for destructuring.
Updates the tutorial to include a simple definition for tuples in section 4.2. Fixes #5132.
1 parent 44d4d6d commit f0d0cbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/tutorial.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,10 @@ omitted.
495495

496496
A powerful application of pattern matching is *destructuring*:
497497
matching in order to bind names to the contents of data
498-
types. Assuming that `(float, float)` is a tuple of two floats:
498+
types.
499+
500+
> ***Note:*** The following code makes use of tuples (`(float, float)`) which
501+
> are explained later. For now you can think of tuples as a list of items.
499502
500503
~~~~
501504
fn angle(vector: (float, float)) -> float {

0 commit comments

Comments
 (0)