Pretty short question: Is it possible to use the Symbol#to_proc shorthand (e.g. lambda(&:upcase) with the stabby lambda syntax in Ruby? For example, I can say this:
p = lambda &:upcase
to get a Proc in p but I can't find an equivalent using ->. This:
I think it has something to do with the fact that proc and lambda are actually methods, and not keywords. They support the same features that we usually associate with each and the other methods from the Enumerable module. However, -> is a special language construct which is parsed separately.
I can't think of a reason why something like -> &:method shouldn't be possible, but as of now the syntax of the Ruby language simply doesn't allow it.