diff options
author | manga_osyo <manga.osyo@gmail.com> | 2021-02-25 17:20:50 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-01-15 09:09:12 +0900 |
commit | 8d378fd28bcce28013499454877678cbbfe7cdc9 (patch) | |
tree | e394c9c325f87e1b4516ffab353aa0e7c4f64fa3 /doc | |
parent | 49cc7709cb762594aa8ea1b98a1fdf41662a5cf6 (diff) |
Add Enumerable::Lazy#with_index to NEWS-2.7.0
The behavior of `Enumerable::Lazy#with_index` has changed in Ruby 2.7.
This change was not listed in the Ruby 2.7 news, so I added it.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4225
Diffstat (limited to 'doc')
-rw-r--r-- | doc/NEWS-2.7.0 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/NEWS-2.7.0 b/doc/NEWS-2.7.0 index 184b47fb8b..7607a473de 100644 --- a/doc/NEWS-2.7.0 +++ b/doc/NEWS-2.7.0 @@ -357,6 +357,16 @@ See also Warning in {Core classes updates}[#label-Core+classes+updates+-28outsta can be directly passed to another method as a block argument. [Feature #15618] + * Added Enumerator::Lazy#with_index be lazy + Previously, Enumerator::Lazy#with_index was not defined, so it + picked up the default implementation from Enumerator, which was + not lazy. [Bug #7877] + + ("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force + # => 1:a + # 2:b + # 3:c + [Fiber] [New method] |