Welcome! Please see the About page for a little more info on how this works.
I wonder why there is no function similar to not-empty but for any value with any predicate, like:
not-empty
(defn when-pred [v pred] (when (pred v) v))
I found this pattern very common and miss it in the core.
Are there reasons for not having it in the core?
JIRA: https://clojure.atlassian.net/projects/CLJ/issues/CLJ-2546
I've added a jira for this (added to description) and some comments on there.
Would cond-> fit the bill? Or maybe when-let ?
cond->
when-let