We have a nice `.()` shorthand for calling Proc ```ruby m = 1.method(:+) m.(2) # 3 ``` But while we can use this shorthand in a Proc's context with the explicit self, we cannot use it with the implicit self: ```ruby m.instance...cvss (Kirill Vechera)
One more reason for having an isolated kind of Proc is using it with an implicit block argument - for `define_method` or for some other metaprogramming. For example, `yield` in this code is incorrect due to the scope capturing problem: ...cvss (Kirill Vechera)
I'm not sure about build parameters, I found this bug at the ruby playground https://try.ruby-lang.org/ I'm attaching a screenshot.cvss (Kirill Vechera)
Alternative solution can be implemented with two hooks for "opening" and "closing" class/module definition i.e. `Module::on_open`. One can get the existing list of constants, methods, class variables etc on the opening, and calculate dif...cvss (Kirill Vechera)
There's also a frequent similar problem with `#find` when you need to find the first matched value instead of entry. But since it involves two semantically different code parts, it a bit more complex and cannot be implemented nicely with...cvss (Kirill Vechera)
> it leads to a proverbial rabbit hole Probably, instead of a separate Patter Match class it would be enough to make a cosy shorthand creating a Proc that encloses a pattern matching code. That way, we avoid right now the need of the in...cvss (Kirill Vechera)
It's a good occasion to use the composition of Proc/Method objects: ``` ruby collection.detect(&:first_name.to_proc>>"Dorian".method(:==)) ``` If we had a shorthand operator for Object#method (#12125), it would look nicer: ``` ruby co...cvss (Kirill Vechera)