Programming Ruby 3.2 (5th Edition): Add &: to Appendix 2. I Can’t Look It up! (page 637)

@noelrappin

I think this thing &: would be a great addition to the list of notation and typography that is called by a name that is not necessarily obvious, making it hard to search for the meaning of a particular line of code. Example code

["text", "more text"].map(&:upcase)

You are right that &:upcase is difficult to understand. It is actually & applied to the symbol :upcase and is described on page 638, 12th symbol (Name Proc operator).

1 Like

Thanks! I did not know how that it worked this way. Good to know it’s already explained in the appendix.