What do we call Ruby’s `&:` syntax in `["a", "b", "c"].map(&:upcase)`? Is that a “symbol-proc”?

So far, I like “pretzel-colon”, but “symbol-proc” is probably most accurate. 🥨

@judofyr @jkreeftmeijer yep, it’s been called “symbol-to-proc” since forever

@solnic @judofyr @citizen428 Thanks, all! “Symbol (to) proc” it is. I must say I like Pretzel-colon too, but I’m a Twiddle-wakka kind of person. ;)

@jkreeftmeijer Since it’s syntactic sugar around Symbol#to_proc that’s what I call it.

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!