<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_lazy_enumerator.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Do not set Enumerator::Lazy#zip to use packed format</title>
<updated>2024-07-21T01:16:42+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2024-07-19T20:08:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7dda086170a5eaa037ddd5ebfcdc3aade15a26d'/>
<id>e7dda086170a5eaa037ddd5ebfcdc3aade15a26d</id>
<content type='text'>
Enumerator#zip yields a single array, not multiple arguments,
so Enumerator::Lazy#zip should do the same.

Fixes [#20623]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enumerator#zip yields a single array, not multiple arguments,
so Enumerator::Lazy#zip should do the same.

Fixes [#20623]
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not have Enumeratory::Lazy#zip mark result as packed</title>
<updated>2023-06-24T15:41:32+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-06-21T16:44:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a14915ca4baae40f08d288a38b8bfb595500ad90'/>
<id>a14915ca4baae40f08d288a38b8bfb595500ad90</id>
<content type='text'>
Fixes [Bug #19569]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #19569]
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #18971] Add precheck to enumerator</title>
<updated>2022-11-25T07:11:17+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-08-25T04:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ffc6c5d056e0f18a9bdfb9b1477d0192a6d37ea3'/>
<id>ffc6c5d056e0f18a9bdfb9b1477d0192a6d37ea3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix lazy enumerator with index size</title>
<updated>2021-05-27T21:17:32+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-05-27T20:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fd8991f797c145615820b4c76e6b7ac5a71339ea'/>
<id>fd8991f797c145615820b4c76e6b7ac5a71339ea</id>
<content type='text'>
Fixes [Bug #17889]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #17889]
</pre>
</div>
</content>
</entry>
<entry>
<title>Improved Enumerable::Lazy#flat_map</title>
<updated>2020-07-23T07:57:26+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-07-21T15:58:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6b3cff12f6add831c678ce7a5288097714bc6850'/>
<id>6b3cff12f6add831c678ce7a5288097714bc6850</id>
<content type='text'>
|        |compare-ruby|built-ruby|
|:-------|-----------:|---------:|
|num3    |     96.333k|  160.732k|
|        |           -|     1.67x|
|num10   |     96.615k|  159.150k|
|        |           -|     1.65x|
|ary2    |    103.836k|  172.787k|
|        |           -|     1.66x|
|ary10   |    109.249k|  177.252k|
|        |           -|     1.62x|
|ary20   |    106.628k|  177.371k|
|        |           -|     1.66x|
|ary50   |    107.135k|  162.282k|
|        |           -|     1.51x|
|ary100  |    106.513k|  177.626k|
|        |           -|     1.67x|
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
|        |compare-ruby|built-ruby|
|:-------|-----------:|---------:|
|num3    |     96.333k|  160.732k|
|        |           -|     1.67x|
|num10   |     96.615k|  159.150k|
|        |           -|     1.65x|
|ary2    |    103.836k|  172.787k|
|        |           -|     1.66x|
|ary10   |    109.249k|  177.252k|
|        |           -|     1.62x|
|ary20   |    106.628k|  177.371k|
|        |           -|     1.66x|
|ary50   |    107.135k|  162.282k|
|        |           -|     1.51x|
|ary100  |    106.513k|  177.626k|
|        |           -|     1.67x|
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Enumerator::Lazy#with_index</title>
<updated>2019-12-11T02:59:56+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-12-10T21:38:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=85e43e1dfecef69b935c48c235cc20f21bd4f0d4'/>
<id>85e43e1dfecef69b935c48c235cc20f21bd4f0d4</id>
<content type='text'>
* Make it correctly handle lambdas
* Make it iterate over the block if block is given

The original implementation was flawed, based on lazy_set_method
instead of lazy_add_method.

Note that there is no implicit map when passing a block, the return
value of the block passed to with_index is ignored, just as it
is for Enumerator#with_index. Also like Enumerator#with_index,
when called with a block, the return value is an enumerator without
the index.

Fixes [Bug #16414]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Make it correctly handle lambdas
* Make it iterate over the block if block is given

The original implementation was flawed, based on lazy_set_method
instead of lazy_add_method.

Note that there is no implicit map when passing a block, the return
value of the block passed to with_index is ignored, just as it
is for Enumerator#with_index. Also like Enumerator#with_index,
when called with a block, the return value is an enumerator without
the index.

Fixes [Bug #16414]
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement Enumerator::Lazy#eager [Feature #15901]</title>
<updated>2019-09-04T07:16:46+00:00</updated>
<author>
<name>Akinori MUSHA</name>
<email>knu@idaemons.org</email>
</author>
<published>2019-06-05T11:39:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1d4bd229b898671328c2a942b04f08065c640c28'/>
<id>1d4bd229b898671328c2a942b04f08065c640c28</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Enumerator::Lazy#{to_enum,enum_for} where method is defined in Lazy</title>
<updated>2019-09-03T18:30:49+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-02T20:22:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7d7a0df91805e59fe6b383ea7ecdad509222966'/>
<id>a7d7a0df91805e59fe6b383ea7ecdad509222966</id>
<content type='text'>
Previously, passing to_enum/enum_for a method that was defined in
Lazy itself returned wrong results:

  [1,2,3].to_enum(:map).to_a
  # =&gt; [1, 2, 3]
  [1,2,3].lazy.to_enum(:map).to_a
  # =&gt; []

I'm not sure why methods that are designed to be lazy do not work
with to_enum/enum_for.  However, one possible way to work around
this bug is to have to_enum/enum_for use the implementation found
in Enumerable/Enumerator, which is what this commit does.

While this commit works around the problem, it is a band-aid, not a
real fix.  It doesn't handle aliases of Enumerable::Lazy methods,
for instance.  A better fix would be appreciated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, passing to_enum/enum_for a method that was defined in
Lazy itself returned wrong results:

  [1,2,3].to_enum(:map).to_a
  # =&gt; [1, 2, 3]
  [1,2,3].lazy.to_enum(:map).to_a
  # =&gt; []

I'm not sure why methods that are designed to be lazy do not work
with to_enum/enum_for.  However, one possible way to work around
this bug is to have to_enum/enum_for use the implementation found
in Enumerable/Enumerator, which is what this commit does.

While this commit works around the problem, it is a band-aid, not a
real fix.  It doesn't handle aliases of Enumerable::Lazy methods,
for instance.  A better fix would be appreciated.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Enumerator::Lazy#with_index be lazy</title>
<updated>2019-09-03T18:30:49+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-08-08T20:09:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e94ac03eb0d07af3cbff20194acf479bf8851c39'/>
<id>e94ac03eb0d07af3cbff20194acf479bf8851c39</id>
<content type='text'>
Previously, Enumerator::Lazy#with_index was not defined, so it
picked up the default implementation from Enumerator, which was
not lazy.

Based on earlier patch from nobu.

Fixes [Bug #7877]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, Enumerator::Lazy#with_index was not defined, so it
picked up the default implementation from Enumerator, which was
not lazy.

Based on earlier patch from nobu.

Fixes [Bug #7877]
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Make Enumerator::Lazy#with_index be lazy"</title>
<updated>2019-09-02T05:35:38+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-02T05:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6724b1f83d2cad57bbcbcdc9756532d825b0c592'/>
<id>6724b1f83d2cad57bbcbcdc9756532d825b0c592</id>
<content type='text'>
This reverts commit 83498854eb5a824f1f83c31fac18c9279f9ee10d.

This didn't pass rubyspec.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 83498854eb5a824f1f83c31fac18c9279f9ee10d.

This didn't pass rubyspec.
</pre>
</div>
</content>
</entry>
</feed>
