Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
damncabbage
on April 2, 2013
|
parent
|
context
|
favorite
| on:
Explicit vs. Clever
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
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
More detail: http://stackoverflow.com/a/1217114/3528