3 ms·
Lisps are not in this camp by default, but in Clojure it's idiomatic to use the threading function to achieve a similar effect. For example, (inc (inc (inc 1
by fnordsensei 7y ago
Lisps are not in this camp by default, but in Clojure it's idiomatic to use the threading function to achieve a similar effect. For example,
(inc (inc (inc 1)))
can be written
(-> 1 inc inc inc)
(`inc` increments a number by one)
There are also several languages that allow method chaining. I.e.,
thing.inc().inc().inc()