What is the rule behind the following behavior:
user=> (take-while #(> 10 %) [2 9 4 12 3 99])
(2 9 4)
user=> (take-while #(> % 10) [2 9 4 12 3 99])
()
Thanks!
There is a pretty big difference between "Is 10 bigger than this number?" and "Is this number bigger than 10?". Those are, respectively, the two predicates you have written, and so of course take-while
behaves differently when given each predicate.