-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data.List: Gradually deprecate old String representation of lambda #764
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress, LGTM.
(small changing need for description)
Co-authored-by: Tsuyoshi CHO <Tsuyoshi.CHO@Gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vital.vim/doc/vital/Data/List.txt
Lines 198 to 202 in 4509690
let xs = range(0, 9) | |
echo s:L.filter(xs, function('Even')) | |
" [0, 2, 4, 6, 8] | |
echo s:L.filter(xs, 'v:val % 2 is 0') | |
" [0, 2, 4, 6, 8] |
vital.vim/doc/vital/Data/List.txt
Lines 226 to 228 in 4509690
uniq_by( | |
\ ['vim', 'Vim', 'VIM', 'emacs', 'Emacs', 'EMACS', 'gVim', 'GVIM'], | |
\ 'tolower(v:val)') == ['vim', 'emacs', 'gVim'] |
vital.vim/doc/vital/Data/List.txt
Lines 323 to 328 in 4509690
echo s:L.max_by( | |
\ ['pineapple', 'orange', 'banana', 'apple'], | |
\ 'len(v:val)') | |
" pineapple | |
echo s:L.max_by([20, -50, -15, 30], function('abs')) | |
" -50 |
vital.vim/doc/vital/Data/List.txt
Lines 338 to 343 in 4509690
echo s:L.min_by( | |
\ ['pineapple', 'orange', 'banana', 'apple'], | |
\ 'len(v:val)') | |
" apple | |
echo s:L.min_by([20, -50, -15, 30], function('abs')) | |
" -15 |
vital.vim/doc/vital/Data/List.txt
Lines 372 to 386 in 4509690
function! Under5(x) abort | |
return a:x < 5 | |
endfunction | |
echo s:L.span('v:val < 5', [1, 3, 5, 2]) | |
" [[1, 3], [5, 2]] | |
echo s:L.span(function('Under5'), [1, 3, 5, 2]) | |
" [[1, 3], [5, 2]] | |
echo s:L.span('v:val==1', [1, 2]) | |
" [[1], [2]] | |
echo s:L.span('v:val > 3', [1, 2, 3, 4, 5]) | |
" [[], [1, 2, 3, 4, 5]] | |
echo s:L.span('v:val < 3', [1, 2, 3, 4, 5]) | |
" [[1, 2], [3, 4, 5]] |
filter(),uniq_by,min_by,max_by,span changed in test, but not fix document.
(suggest late sorry)
What is need change?
Yes, that's the plan at the next changes 👍 |
still keeps the behaviour (CHANGELOG needed)