Closed alinposho closed 3 years ago
This might be a function that's too specific in scope for Medley.
Thanks for the feedback! I will close the PR. If anyone finds it useful, we can always re-open it.
P.S. Perhaps the name that I chose does not make the function justice: I think of it as an improved clojure.core/empty?
that works with numbers, or any other object that you throw at it, whereas the standard lib empty?
raises and exception for anything that is not a collection or nil.
I often find myself re-implementing the function that I just added in this PR, in my projects, so I thought others might benefit from it. A common use case is: needing to cleanup some hashmap's values, e.g.
But, I always have to remember to check for numbers in my collections, because, obviously:
What I'd like to be able to do is:
Last but not least, I'm not that thrilled about the name for the function:
nil-or-empty?
, butempty?
has been taken already...Let me know what you think.