On 2021-01-09 11:39, Yegappan Lakshmanan wrote:
> The lambda function is called with two arguments (the index of the
> current item in the list and the value of the item).
>
> :put=map(range(1, 10), {i, v -> v})
Ah, that makes sense. I missed that part in the docs:
If {expr2} is a |Funcref| it is called with two arguments:
1. The key or the index of the current item.
2. the value of the current item.
and now I know. Thanks!
-tim
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210109135644.0daef11a%40bigbox.attlocal.net.
Saturday, January 9, 2021
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment