Skip to content

Commit 1e1b70a

Browse files
author
Alex Razoumov
committed
add a sentence about the dual use of square brackets with arrays: declaration and subsetting
1 parent 85c1a07 commit 1e1b70a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

episodes/03-ranges-arrays.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ different from languages like Python where this does not happen.
8181

8282
## Indexing elements
8383

84-
We can retrieve and reset specific values of an array using `[]` notation. Let's try retrieving and setting a
85-
specific value in our example so far:
84+
We can retrieve and reset specific values of an array using `[]` notation. Note that we use the same square
85+
bracket notation in two different contexts: (1) to declare an array, with the square brackets containing the
86+
array's full index range `[example_range]`, and (2) to access specific array elements, as we will see
87+
below. Let's try retrieving and setting a specific value in our example so far:
8688

8789
```chpl
8890
var example_range = 0..10;

0 commit comments

Comments
 (0)