[#83096] File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?}) — Nobuyoshi Nakada <nobu@...>
On 2017/10/04 8:47, normal@ruby-lang.org wrote:
5 messages
2017/10/04
[#83100] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Eric Wong <normalperson@...>
2017/10/04
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#83105] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Nobuyoshi Nakada <nobu@...>
2017/10/04
On 2017/10/04 15:55, Eric Wong wrote:
[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>
Hello,
9 messages
2017/10/04
[#83113] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/05
This has been requested countless times, then rejected each and every time.
[#83129] Re: Alias Enumerable#include? to Enumerable#includes?
— Alberto Almagro <albertoalmagro@...>
2017/10/05
Sorry I didn't found it on the core mail list's archive.
[#83138] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/06
Ruby has not been made of popular votes so far. You have to show us
[#83149] Re: Alias Enumerable#include? to Enumerable#includes?
— Eric Wong <normalperson@...>
2017/10/06
Alberto Almagro <albertoalmagro@gmail.com> wrote:
[#83200] [Ruby trunk Feature#13996] [PATCH] file.c: apply2files releases GVL — normalperson@...
Issue #13996 has been reported by normalperson (Eric Wong).
4 messages
2017/10/10
[ruby-core:83380] [Ruby trunk Feature#13777][Rejected] Array#delete_all
From:
matz@...
Date:
2017-10-19 07:28:32 UTC
List:
ruby-core #83380
Issue #13777 has been updated by matz (Yukihiro Matsumoto).
Status changed from Open to Rejected
The name `delete_all` is not acceptable. This method works as a modifying version of `partition`. The name does not indicate the fact. This can be achieved by
```
result = []
ary.delete_if do|e|
if cond(e)
result << e
true
end
end
```
If the use-case is frequent and needs to be supported by the core, we will re-investigate. Please reopen.
Matz.
----------------------------------------
Feature #13777: Array#delete_all
https://bugs.ruby-lang.org/issues/13777#change-67341
* Author: k0kubun (Takashi Kokubun)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
I want Array#delete_if which returns array of deleted values.
For following code,
~~~
array = ["a", "aa", "ab", "bb", "c"]
result = {}
until array.empty?
key = array.first
group, array = array.partition { |v| v.start_with?(key) }
result[key] = group
end
result #=> {"a"=>["a", "aa", "ab"], "bb"=>["bb"], "c"=>["c"]}
~~~
With Array#delete_all, This would be able to be written in more elegant way like:
~~~
array = ["a", "aa", "ab", "bb", "c"]
result = {}
until array.empty?
key = array.first
result[key] = array.delete_all { |v| v.start_with?(key) }
end
result #=> {"a"=>["a", "aa", "ab"], "bb"=>["bb"], "c"=>["c"]}
~~~
This is simplified source code of real use case in Haml: https://github.com/haml/haml/blob/923a0d78874fe1d369f8c7a0bf77f67b2c2139bb/lib/haml/attribute_compiler.rb#L75-L76
This grouping task is necessary for Haml optimization.
Do you know simpler way to write this with existing methods?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>