| ▲ | Blikkentrekker 3 hours ago | |
I feel languages should just have some kind of sugar or operator for this, in fact in Ocaml the |> operator exists where
Are just one and the sameFor a variadic language you'd need something more involved though. But some kind of syntax can probably be invented in some language. | ||
| ▲ | emidln 2 hours ago | parent [-] | |
It's common to write the thrush combinator as a lisp macro. Clojure ships ->, ->>, as->, some->, some->>, cond->, and cond->> out of the box. You can find similar macros for CL[0], Racket[1], and a scheme SRFI[2]. Writing them is a fun exercise in your lisp of choice if you don't have a library available. [0] https://github.com/dtenny/clj-arrows | ||