Other Ruby Map Shorthand Notation
问题 I am aware of the shorthand for map that looks like: [1, 2, 3, 4].map(&:to_s) > ["1", "2", "3", "4"] I was told this is shorthand for: [1, 2, 3, 4].map{|i| i.to_s} This makes perfect sense. My question is this: It seems there should be an easier way to write: [1, 2, 3, 4].map{|x| f.call(x)} for some procedure f. I know the way I just typed isn't all that long to begin with, but I'd contend that neither is the previous example for which the shorthand exists. This example just seems like the