Hacker News new | ask | show | jobs
by fantispug 588 days ago
I find this style changes the way I think about and write code transformations. It's also in shell pipelines, R's magrittr, and Clojure's thread macros, and can be emulated in some OO languages with methods that return the transformed object itself.
3 comments

> R's magrittr

These days, base R already includes a native pipe operator (and it is literally `|>`, rather than magrittr's `%>%`).

It also works with universal function call syntax line in Nim. Though aesthetically I prefer `|>` for multi-line expressions.
yeah, in lua some libs are used just like this, using the : syntatic sugar, something line

value = table:function1():function2():function3()