[#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:83468] [Ruby trunk Bug#12091] Freezing a SortedSet breaks Enumerable
From:
knu@...
Date:
2017-10-21 15:39:05 UTC
List:
ruby-core #83468
Issue #12091 has been updated by knu (Akinori MUSHA).
Fixed, thanks!
----------------------------------------
Bug #12091: Freezing a SortedSet breaks Enumerable
https://bugs.ruby-lang.org/issues/12091#change-67468
* Author: drewish (Andrew Morton)
* Status: Closed
* Priority: Normal
* Assignee: knu (Akinori MUSHA)
* Target version:
* ruby -v: ruby 2.4.0dev (2016-02-20 trunk 53876) [x86_64-darwin15]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
If you freeze a `SortedSet` it looses most functionality because of the way `to_a` is implemented:
```
irb(main):001:0> require 'set'
=> true
irb(main):002:0> Set.new.freeze
=> #<Set: {}>
irb(main):003:0> SortedSet.new.freeze
RuntimeError: can't modify frozen SortedSet
from /Users/andrew/.rbenv/versions/2.3.0-dev/lib/ruby/2.4.0/set.rb:679:in `to_a'
from /Users/andrew/.rbenv/versions/2.3.0-dev/lib/ruby/2.4.0/set.rb:541:in `inspect'
from /Users/andrew/.rbenv/versions/2.3.0-dev/bin/irb:11:in `<main>'
```
And since `each` method relies on `to_a`, all the `Enumerable` methods are also broken:
```
irb(main):006:0> SortedSet.new([1, 2, 2]).freeze.max
RuntimeError: can't modify frozen SortedSet
from /Users/andrew/.rbenv/versions/2.3.0-dev/lib/ruby/2.4.0/set.rb:679:in `to_a'
from /Users/andrew/.rbenv/versions/2.3.0-dev/lib/ruby/2.4.0/set.rb:674:in `each'
from (irb):6:in `max'
from (irb):6
from /Users/andrew/.rbenv/versions/2.3.0-dev/bin/irb:11:in `<main>'
```
The relevant code is:
```ruby
def to_a
(@keys = @hash.keys).sort! unless @keys
@keys
end
```
--
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>