maktaba#function#Filter modifies input
- Dominant language
- Vim Script
- Stars
- 588
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Documentation for `maktaba#function#Filter` says `This is like |filter|, except {func} may be any maktaba callable and a new list is created. Unlike the builtin filter() function, {list} WILL NOT be modified in place.`
The output from the following test indicates that it _does_ modify the input.
```vim
let s:numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
echo 'starting list is' s:numbers
let s:odds = maktaba#function#Filter(s:numbers, {x -> x % 2 == 1})
echo 'list with odds is' s:odds
let s:threes = maktaba#function#Filter(s:odds, {x -> x % 3 == 0})
echo 'list with threes is' s:threes
echo 'now odds is' s:odds
echo 'now numbers is' s:numbers
```
Output:
```
starting list is [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list with odds is [1, 3, 5, 7, 9]
list with threes is [3, 9]
now odds is [3, 9]
now numbers is [3, 9]
```
Contributor guide
Assessment
This issue has not been assessed yet.