Reputation: 361
Is there a better way to implement this?
(if (empty? a-seq) nil a-seq)
Upvotes: 3
Views: 555
Don't know how I missed it in the docs, but not-empty does exactly that (thank you Guillermo for making me re-read the docs).
Upvotes: 6
Reputation: 4702
Use the function seq it does exactly that.
Upvotes: 10