Files
neovim/runtime/doc
Gregory Anders 9489406879 fix(iter): remove special case totable for map-like tables
This was originally meant as a convenience but prevents possible
functionality. For example:

  -- Get the keys of the table with even values
  local t = { a = 1, b = 2, c = 3, d = 4 }
  vim.iter(t):map(function(k, v)
    if v % 2 == 0 then return k end
  end):totable()

The example above would not work, because the map() function returns
only a single value, and cannot be converted back into a table (there
are many such examples like this).

Instead, to convert an iterator into a map-like table, users can use
fold():

  vim.iter(t):fold({}, function(t, k, v)
    t[k] = v
    return t
  end)
2023-04-19 07:52:04 -06:00
..
2023-04-17 15:46:24 +08:00
2023-04-04 19:07:33 +02:00
2023-02-03 09:18:18 +01:00
2021-09-10 08:48:27 +02:00
2022-02-27 11:56:30 +01:00
2023-01-01 15:05:13 +01:00
2023-01-01 15:05:13 +01:00
2023-02-22 00:07:26 +08:00
2023-01-01 15:05:13 +01:00
2023-04-13 12:15:30 +02:00
2023-02-22 00:07:26 +08:00
2023-04-04 19:07:33 +02:00
2023-04-04 19:07:33 +02:00
2023-01-01 15:05:13 +01:00
2022-10-14 08:01:13 -07:00
2023-02-22 00:07:26 +08:00
2023-04-17 12:54:19 -06:00
2022-12-11 18:41:26 -08:00
2023-04-17 15:46:24 +08:00
2018-10-29 09:55:07 +01:00
2018-10-29 09:55:07 +01:00
2023-04-11 19:10:36 +02:00
2015-08-15 15:25:30 -03:00
2023-02-22 00:07:26 +08:00
2023-02-22 00:07:26 +08:00
2023-01-01 15:05:13 +01:00
2023-04-04 19:07:33 +02:00
2023-04-04 19:07:33 +02:00
2022-09-26 17:43:23 +08:00
2023-02-20 15:12:59 +08:00
2023-01-01 15:05:13 +01:00
2023-04-04 23:10:17 +02:00
2022-07-26 11:26:23 +02:00
2022-11-10 09:05:25 +00:00
2023-04-11 19:10:36 +02:00
2023-01-03 10:07:43 +00:00
2023-04-13 12:15:30 +02:00
2021-05-01 22:29:02 -04:00
2021-05-02 12:53:49 -04:00
2021-05-01 22:29:03 -04:00
2021-04-27 09:21:33 -04:00
2018-10-29 10:01:44 +01:00
2021-04-29 09:27:19 -04:00
2018-10-29 10:01:44 +01:00
2021-04-29 20:42:16 -04:00
2019-03-26 19:55:33 +01:00
2021-04-27 09:21:34 -04:00
2023-01-03 10:07:43 +00:00
2023-01-03 10:07:43 +00:00
2023-04-13 12:15:30 +02:00
2022-11-10 09:05:25 +00:00
2023-02-22 00:07:26 +08:00