Show HN: Magrittr-like pipe syntax for IPython(github.com)
github.com
Show HN: Magrittr-like pipe syntax for IPython
https://github.com/smacke/pipescript
1 comments
Some auto formatting italicized the text between * on different lines :')
Should be `reduce[$*$]`
Should be `reduce[$*$]`
42 |> $+1 # 43
The $ is a placeholder for the value in the previous pipeline step, like (.) in magrittr.
There's a ton more you can do thanks to macro expansion capabilities added by pipescript. Here's 5 factorial:
range(1, 6) |> reduce[$$] # 120
Placeholders can also be given informative names unlike in magrittr:
range(1, 6) |> reduce[$accum$current] # 120
The lack of names placeholders in magrittr had been my biggest complaint. Anyway I had a lot of fun scratching this itch and am really proud of the result, hope you like it too. :)