[#88925] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
4 messages
2018/09/09
[#88927] Re: [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical
— Eric Wong <normalperson@...>
2018/09/09
[email protected] wrote:
[#88926] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
3 messages
2018/09/09
[#89218] [Ruby trunk Bug#15130] open-uri hangs on cygwin — duerst@...
SXNzdWUgIzE1MTMwIGhhcyBiZWVuIHVwZGF0ZWQgYnkgZHVlcnN0IChNYXJ0aW4gRMO8cnN0KS4K
5 messages
2018/09/30
[ruby-core:89026] [Ruby trunk Bug#15123] Enumerable#compact proposal
From:
eregontp@...
Date:
2018-09-15 07:46:02 UTC
List:
ruby-core #89026
Issue #15123 has been updated by Eregon (Benoit Daloze).
marcandre (Marc-Andre Lafortune) wrote:
> Also `compact` is roughly `select(&:itself)`, not `reject(&:nil?)` which would wrongly keep `false`.
No, #compact only removes `nil`: `["a" ,false ,nil].compact` => `["a", false]`.
----------------------------------------
Bug #15123: Enumerable#compact proposal
https://bugs.ruby-lang.org/issues/15123#change-74051
* Author: printercu (Max Melentiev)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
* ruby -v:
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Hi!
While Enumerable does not provide `#compact` method, it requires changing code in some cases to substitute array with enumerator.
For example, to reduce memory usage it's usual to change `large_array.map { to_heavy_object }.chained_methods` to `large_array.lazy...`. However if `chained_methods` contains `compact`, this change will fail. Replacing `compact` with `reject(&:nil?)` fixes it.
What do you think about adding `#compact` to Enumerable?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>