Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    $\begingroup$ Two useful takeaways here: Firstly, the extra brevity from avoiding (#&) is only part of the story. Operator forms also remove the need for Function usage for nested pure functions but further, even this doesn't seem to capture the advantages since when it comes to readability and conceptualisation it really does seem to be a case of the "whole being greater than the sum of the parts". Secondly, even when an operator form is not built in, one can readily be defined if warranted by the code. $\endgroup$ Commented Aug 4, 2014 at 13:22
  • $\begingroup$ This last point -defining your own operator form if needs be - is touched upon in the documentation (e.g. via the matches definition in the "titanic neat example") although perhaps it would have been worth emphasising a little more given its role in building up more powerful queries. It also relates to my speculation about these forms being automatically detectable given that most functions have a natural "data argument" (and/or other arguments can be inferred from the context). It also raises the spectre of wholesale code refactoring for improving the maintainability of legacy codebases. $\endgroup$ Commented Aug 4, 2014 at 13:37
  • $\begingroup$ @Mr.Wizard , I think your last example is even simpler to understand written this way because operations are written in the same order they are processed: Range@9//partition[3]//Map[Append[11]]//Map[SortBy[mod@5]] . I use the style described in this post mathematica-guide.blogspot.co.uk/2011/12/… $\endgroup$ Commented Apr 28, 2015 at 14:47