News for hackers. Stuff that matters.
Re:Explicit vs. Clever by damncabbage on Tuesday April 02, 2013 @06:56PM (#5482789)
Party time with Ruby:

  orders.map(&:total)
... Where :total is a symbol, and & is asking :total for the Proc version of itself (a Proc being an anonymous function of sorts), and map is then calling that Proc with a single argument (an order from the list of orders).

More detail: http://stackoverflow.com/a/1217114/3528

There are no comments on this comment yet.