New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "safe" versions of select and select-one #123
Comments
I think you're looking for select-one!? |
What I'm looking for is:
|
If you use (select-one! [(must :foo) (must :bar)] {:foo {:baz 1}}) |
How would I write a safe version of the following using
|
(select-one! [(must 10) (must 30)] {10 {20 "treasure"}}) |
Ah sorry, that was rather obvious. I now see the point of |
There's a pretty common sentiment that
safe-get
andsafe-get-in
, i.e. versions ofget
andget-in
that throw an exception instead ofnil
for when no value is found, should be included inclojure.core
. Sincespecter
is already such a good alternative to never using those two, it would be nice if it fixed this annoyance by providing versions ofselect
andselect-one
that behave in this manner.The text was updated successfully, but these errors were encountered: