Each pattern is exposed to the client as a slice of the original
content, where the slice is transient. If you need to retain the
exposed content, then you should .dup it appropriately.
The content exposed via an iterator is supposed to be entirely
read-only. All current iterators abide by this rule, but it is
possible a user could mutate the content through a get() slice.
To enforce the desired read-only aspect, the code would have to
introduce redundant copying or the compiler would have to support
read-only arrays.
Iterate across a set of text patterns.
Each pattern is exposed to the client as a slice of the original content, where the slice is transient. If you need to retain the exposed content, then you should .dup it appropriately.
The content exposed via an iterator is supposed to be entirely read-only. All current iterators abide by this rule, but it is possible a user could mutate the content through a get() slice. To enforce the desired read-only aspect, the code would have to introduce redundant copying or the compiler would have to support read-only arrays.
See Lines, Patterns, Quotes.