Skip to content

Commit 9087949

Browse files
authored
Slices do not necessarily return a contiguous sequence. (#84)
* Slices do not necessarily return a contiguous sequence. * Addressed PR feedback.
1 parent 66a01d4 commit 9087949

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

GRAMMAR.ABNF

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ bracket-specifier =/ "[]" ;; ## Flatten Operator
252252
;; ```
253253

254254
slice-expression = [number] ":" [number] [ ":" [number] ] ;; ## Slices
255-
;; A slice expression allows you to select a contiguous subset of an array. A slice has a start, stop, and step value. The
255+
;; A slice expression allows you to select a subset of an array. A slice has a start, stop, and step value. The
256256
;; general form of a slice is [start:stop:step], but each component is optional and can be omitted.
257257
;;
258258
;; ```note
@@ -264,9 +264,11 @@ slice-expression = [number] ":" [number] [ ":" [number] ] ;; ## Slices
264264
;;
265265
;; - The first element in the extracted array is the index denoted by start.
266266
;; - The last element in the extracted array is the index denoted by end - 1.
267-
;; - The step value determines how many indices to skip after each element is selected from the array. An array of 1
268-
;; (the default step) will not skip any indices. A step value of 2 will skip every other index while extracting elements
269-
;; from an array. A step value of -1 will extract values in reverse order from the array.
267+
;; - The step value determines how many indices to skip after each element is selected from the array.
268+
;; The default step value of 1 will not skip any indices and will return a contiguous subset of the original array.
269+
;; A step value greater than 1 will skip indices while extracting elements from an array. For instance, a step value of 2 will
270+
;; skip every other index.
271+
;; Negative step values start from the end of the array and extract elements in reverse order.
270272
;;
271273
;; Slice expressions adhere to the following rules:
272274
;;

0 commit comments

Comments
 (0)