[#71439] [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API — matz@...
Issue #11339 has been updated by Yukihiro Matsumoto.
7 messages
2015/11/11
[#71473] Re: [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API
— Eric Wong <normalperson@...>
2015/11/13
Entire series for sockets
[#71450] Ruby 2.3.0-preview1 Released — "NARUSE, Yui" <naruse@...>
Hi,
5 messages
2015/11/11
[#71617] [Ruby trunk - Feature #11664] [PATCH] introduce rb_autoload_value to replace rb_autoload — nobu@...
Issue #11664 has been updated by Nobuyoshi Nakada.
3 messages
2015/11/20
[#71721] [Ruby trunk - Feature #11741] Migrate Ruby to Git from Subversion — me@...
Issue #11741 has been updated by Jon Moss.
4 messages
2015/11/28
[ruby-core:71358] [Ruby trunk - Feature #11286] [PATCH] Add case equality arity to Enumerable's sequence predicates.
From:
0x0dea+redmine@...
Date:
2015-11-05 22:09:08 UTC
List:
ruby-core #71358
Issue #11286 has been updated by D.E. Akers.
I've come to realize that it might not be entirely clear what is being proposed. In essence, all of the following examples feel very "Ruby" and should, in my opinion, Just Work.
```ruby
[1, 3.14, 2ri].all?(Numeric) # => true
if should_be_all_symbols.any?(String)
...
end
some_strings.none?(/aeiou/i)
lotto.all?(1..49) && lotto.one?(43..49)
```
----------------------------------------
Feature #11286: [PATCH] Add case equality arity to Enumerable's sequence predicates.
https://bugs.ruby-lang.org/issues/11286#change-54723
* Author: D.E. Akers
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
## Proposal
It is proposed that `Enumerable`'s sequence predicates (`#all?`, `#any?`, `#none?`, and `#one?`) be augmented to return, in the case of a single argument, whether their query holds when each element is supplied to the argument's `#===` method.
## Rationale
`Enumerable#grep` filters by case equality, allowing us to write very natural and expressive code:
```ruby
strs.select { |str| /foo/ === str }
strs.grep(/foo/)
nums.select { |num| (5..10) === num }
nums.grep(5..10)
```
In addition to taking advantage of the versatility of case equality, it lets us do away with the syntactic noise incurred by opening a block. `#grep` is a very nice method! Let's make `#all?` and friends more like `#grep`.
---Files--------------------------------
0001-enum.c-add-case-equality-arity-to-sequence-predicates.patch (10 KB)
case_equality_sequence_predicates-check_argc_before_deref.patch (10 KB)
case_equality_sequence_predicates-all_updates.patch (9.94 KB)
--
https://bugs.ruby-lang.org/