[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97331] [Ruby master Feature#16667] Allow parameters to Symbol#to_proc and Method#to_proc
From:
sawadatsuyoshi@...
Date:
2020-03-03 05:34:32 UTC
List:
ruby-core #97331
Issue #16667 has been updated by sawa (Tsuyoshi Sawada).
jgomo3 (Jes俍 Gez) wrote in #note-3:
> The idea is to extend **to_proc** so it creates a **Proc** that calls the method on the given object using as arguments the parameters set in **to_proc** call.
>
> So,
>
> `:dig.to_proc(:id)[ary]` would be the same as `ary.dig(:id)`.
I already know that. That does not make `ary.map(:dig.to_proc(:id))` work. You seemed to have missed my point.
----------------------------------------
Feature #16667: Allow parameters to Symbol#to_proc and Method#to_proc
https://bugs.ruby-lang.org/issues/16667#change-84453
* Author: jgomo3 (Jes俍 Gez)
* Status: Open
* Priority: Normal
----------------------------------------
Allow parameters to Symbol#to_proc and Method#to_proc
So we can say:
``` ruby
ary.map(:dig.to_proc(:id))
```
Instead of
``` ruby
ary.map { |e| e.dig(:id) }
```
Oppening the posibilities to refine the `&` operator in the future, for something like:
``` ruby
ary.map(&(:dig, :id))
```
Related:
* https://bugs.ruby-lang.org/issues/11161
* https://bugs.ruby-lang.org/issues/16435
--
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>