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

Mathematica has this:

    In[1]:  Map((1 + #1)&, {a, b, c})
    Out[1]: {a + 1, b + 1, c + 1}
See https://reference.wolfram.com/language/ref/Function.html.en for the full story.


What is that & doing there? I thought it looks neat, but then that & ...


The & is a postfix operator that converts an expression into an anonymous function. See “Pure Functions”:

https://reference.wolfram.com/language/tutorial/FunctionalOp...




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

Search: