I don’t think it’s really less elegant in Python or Swift. Especially not in Swift where you can write it very concisely in some cases, like numbers.reduce(0, +). Admittedly Python is a bit more verbose.
But maybe Python and Swift programmers are not used to it in the same way as Clojure programmers are.
I don’t think it’s really less elegant in Python or Swift. Especially not in Swift where you can write it very concisely in some cases, like numbers.reduce(0, +). Admittedly Python is a bit more verbose.
But maybe Python and Swift programmers are not used to it in the same way as Clojure programmers are.
also python has built-ins for sum, min, max, and math.prod - which account for a lot of use cases of reduce in a more readable way.
But if you’re really crunching numbers, it’s just better to go with something like numpy, pandas, polars, …