by throwawaw · 6y ago · 0 comments
(case [(> n min) (< n max)]
[true true] n
[true false] max
[false true] min)
(Side note: Clojure's `>` and `<` are kind of unreadable to begin with. Turning `if (> n min)` into "if n is greater than min" takes some work for me, still, after more than a year.) (> 3 2 1 ...)
vs (3 > 2) && (2 > 1) && ... (-> n
(max vmin)
(min vmax))I felt the same for awhile but now I just mentally put the operator between the operands, so (> 3 2) is the same as 3 > 2.