Skip to content

Commit

Permalink
Doc updates for #960
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Feb 22, 2022
1 parent 6dde90a commit 277d2d0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/src/reference-main-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ x[4], x[5]]`.

## Out-of-bounds indexing

Somewhat imitating Python, out-of-bounds index accesses are
[absent](reference-main-null-data.md), but out-of-bounds slice accesses result
in trimming the indices, resulting in a short array or even the empty array:
Out-of-bounds index accesses are [absent](reference-main-null-data.md), but out-of-bounds slice
accesses result in trimming the indices, resulting in a short array or even the empty array. (This
behavior intentionally imitates Python.)

<pre class="pre-highlight-in-pair">
<b>mlr -n put '</b>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/reference-main-arrays.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ GENMD-EOF

## Out-of-bounds indexing

Somewhat imitating Python, out-of-bounds index accesses are
[absent](reference-main-null-data.md), but out-of-bounds slice accesses result
in trimming the indices, resulting in a short array or even the empty array:
Out-of-bounds index accesses are [absent](reference-main-null-data.md), but out-of-bounds slice
accesses result in trimming the indices, resulting in a short array or even the empty array. (This
behavior intentionally imitates Python.)

GENMD-RUN-COMMAND
mlr -n put '
Expand Down
20 changes: 10 additions & 10 deletions docs/src/reference-main-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,17 @@ bcd

## Out-of-bounds indexing

Somewhat imitating Python, out-of-bounds index accesses are
[errors](reference-main-data-types.md), but out-of-bounds slice accesses result
in trimming the indices, resulting in a short string or even the empty string:
Out-of-bounds index accesses are [errors](reference-main-data-types.md), but out-of-bounds slice
accesses result in trimming the indices, resulting in a short string or even the empty string.
(This behavior intentionally imitates Python.)

<pre class="pre-highlight-in-pair">
<b>mlr -n put '</b>
<b> end {</b>
<b> x = "abcde";</b>
<b> print x[1];</b>
<b> print x[5];</b>
<b> print x[6]; # absent</b>
<b> print x[6];</b>
<b> }</b>
<b>'</b>
</pre>
Expand All @@ -146,16 +146,16 @@ e
<b>mlr -n put '</b>
<b> end {</b>
<b> x = "abcde";</b>
<b> print x[1:2];</b>
<b> print x[1:6];</b>
<b> print x[10:20];</b>
<b> print "\"" . x[1:2] . "\"";</b>
<b> print "\"" . x[1:6] . "\"";</b>
<b> print "\"" . x[10:20] . "\"";</b>
<b> }</b>
<b>'</b>
</pre>
<pre class="pre-non-highlight-in-pair">
ab
abcde

"ab"
"abcde"
""
</pre>

## Escape sequences for string literals
Expand Down
14 changes: 7 additions & 7 deletions docs/src/reference-main-strings.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ GENMD-EOF

## Out-of-bounds indexing

Somewhat imitating Python, out-of-bounds index accesses are
[errors](reference-main-data-types.md), but out-of-bounds slice accesses result
in trimming the indices, resulting in a short string or even the empty string:
Out-of-bounds index accesses are [errors](reference-main-data-types.md), but out-of-bounds slice
accesses result in trimming the indices, resulting in a short string or even the empty string.
(This behavior intentionally imitates Python.)

GENMD-RUN-COMMAND
mlr -n put '
end {
x = "abcde";
print x[1];
print x[5];
print x[6]; # absent
print x[6];
}
'
GENMD-EOF
Expand All @@ -99,9 +99,9 @@ GENMD-RUN-COMMAND
mlr -n put '
end {
x = "abcde";
print x[1:2];
print x[1:6];
print x[10:20];
print "\"" . x[1:2] . "\"";
print "\"" . x[1:6] . "\"";
print "\"" . x[10:20] . "\"";
}
'
GENMD-EOF
Expand Down

0 comments on commit 277d2d0

Please sign in to comment.