Open justinmk opened 1 year ago
it1:chain(it2)
would be nice.
Maybe expose also ListIter.new? So that the programmer can bypass list check loop if he knows beforehand that his table is definitely a list. https://github.com/neovim/neovim/blob/558e4191f049662065984677a9c7cdbb1518092a/runtime/lua/vim/iter.lua#L781-L789
expose also ListIter.new? So that the programmer can bypass list check loop if he knows beforehand that his table is definitely a list.
Could do this as kwargs (opt
) parameter on vim.iter()
itself. In general, we should probably use that pattern for all functions that accept a table/list/etc (while keep the common case low-verbosity).
I now noticed that this loop creates a copy of the table. There probably was a reason for this. So it is unavoidable if we don't want to mutate user's table.
range(i, j)
is fine
Problem
vim.iter()
was added in https://github.com/neovim/neovim/pull/23029 . This issue tracks related functions on there.Related:
vim.func
https://github.com/neovim/neovim/issues/28449Expected behavior
Iter:fold()
)d and d[k]
is idiomatic.