If coll is empty, returns nil, else coll
user=> (not-empty [1]) [1] user=> (not-empty [1 3 5]) [1 3 5] user=> (not-empty []) nil user=> (not-empty '()) nil user=> (not-empty {}) nil user=> (not-empty nil) nil
;; if-let can now work with colls also, not being limited to scalar values alone user> (if-let [valid (not-empty (filter even? [2 4 6]))] valid) (2 4 6) ;; if-let helps avoid another nested if check user> (if-let [valid (not-empty (filter even? [1 3 5]))] valid) nil ;; without not-empty we would have to work with another if conditional user> (if-let [valid (filter even? [1 3 5])] valid) ()
Returns an empty collection of the same category as coll, or nil
Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather ...
Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil...
not-empty