Skip to content

Commit f4449ed

Browse files
committed
add descriptions of scalar return values
1 parent f99d888 commit f4449ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ppcs/ppc0033-map-grep-with-topic.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ On the last iteration, there may not be enough elements remaining to fill
8888
every `VAR` slot. In this case, a warning will be issued, and the extra `VAR`
8989
slots will be filled with `undef`.
9090

91+
In scalar context, the return value will be the number of elements generated.
92+
9193
### `grep my (VAR, VAR) BLOCK LIST`
9294

9395
This will evaluate `BLOCK` for each set of two elements in `LIST`, aliasing
@@ -99,6 +101,10 @@ every `VAR` slot. In this case, a warning will be issued, and the extra `VAR`
99101
slots will be filled with `undef`. The extra `undef` values used will also be
100102
included in the returned list.
101103

104+
In scalar context, this will return number of elements that would have been
105+
generated. This means it will always be a multiple of the count of `VAR`
106+
slots.
107+
102108
## Backwards Compatibility
103109

104110
As the syntax chosen is currently invalid, it should not present any backwards

0 commit comments

Comments
 (0)