I'd also like to advocate for this. We're working on a gem that allows you to easily memoize a method while still preserving that method's visibility, and without `Method#visibility` we have to [awkwardly hack around it](https://github.c...jacobevelyn (Jacob Evelyn)
sawa (Tsuyoshi Sawada) wrote in #note-5: > Includes a duplicate of #14788. I just want to note that this is proposal is for a *more powerful* feature than what's proposed in #14788, because both the key and value would be available to t...jacobevelyn (Jacob Evelyn)
> All it does is saves you from typing `select`. It does not look like the proposed feature makes much difference unless such situation is frequently met. Do you have any use case? I see code that could be improved with this all the tim...jacobevelyn (Jacob Evelyn)
I often see code like the following: ``` ruby hash.select { |_, v| v == :some_value }.keys hash.keys.select { |k| k.nil? || k.even? } hash.select { |k, v| valid_key?(k) && valid_value?(v) }.values ``` Each of these code snippet...jacobevelyn (Jacob Evelyn)
The following code produces segmentation faults in Ruby 2.5.0, 2.5.1, and 2.6.0dev (2018-09-07 trunk 64656). This code worked in Ruby 2.4.1. ~~~ ruby test_proc = Proc.new { "test" } def foo(bar: 1, &block) yield end foo(**{}, &...jacobevelyn (Jacob Evelyn)
Ah you're right Jeremy, I hadn't thought about that case. I still think it's unexpected though that in your example the behavior would change if we split the conditional into an `if...end`, but I don't know if others agree, and I don't k...jacobevelyn (Jacob Evelyn)
I agree the `did_you_mean` message is not good, but I would rather change the behavior so that line of code works and doesn't produce an error at all.jacobevelyn (Jacob Evelyn)
I just learned that these two pieces of code are not the same: ~~~ ruby def test if result = calculate_result return result end ... end ~~~ ~~~ ruby def test return result if result = calculate_result .....jacobevelyn (Jacob Evelyn)
Unfortunately I haven't found a way to reproduce this without a large portion of our code running, and because the error happens in different places I haven't been able to track it down. I'll keep trying but I think it is unlikely that I...jacobevelyn (Jacob Evelyn)