Want this course?
Multi-comparison Usage Pattern
A very common pattern you'll see in Clojure code in the wild is using a Set to do multiple comparisons in constant time. You can exploit the fact that Sets can be called as functions to make a quick predicate.
Code is available: lispcast/clojure-collections
You can checkout the code in your local repo with this command:
$CMD git clone https://github.com/lispcast/clojure-collections.git $CMD cd clojure-collections
When you need to modify an immutable value, you actually make a modified copy. If you make a lot of changes, you make a copy for each change. If you're just going to throw those copies away, that is a major waste. Transients let you create a local mutable copy of a collection, modify it, and then freeze it. When used with large-batch modifications, it can significantly improve performance.