Follow

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
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!