Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We call it the "capture" operator. What it does is it captures the nth parameter of the anonymous function. Like some have already said, the number just signifies which parameter you're making a reference to in the function body. It's terse and comes in handy for ad-hoc stuff. I prefer verbosity and often write Elixir code with the standard syntax and find myself using the capture operator a lot more in the REPL.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: