Skip to content

Commit

Permalink
add a sentence about the dual use of square brackets with arrays: dec…
Browse files Browse the repository at this point in the history
…laration and subsetting
  • Loading branch information
Alex Razoumov committed Sep 27, 2024
1 parent 85c1a07 commit 1e1b70a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions episodes/03-ranges-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ different from languages like Python where this does not happen.

## Indexing elements

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

```chpl
var example_range = 0..10;
Expand Down

0 comments on commit 1e1b70a

Please sign in to comment.