-
Notifications
You must be signed in to change notification settings - Fork 5
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
Without statement for Results #9
Conversation
An alternative syntax that was considered but not implemented: without (value, error) =? r:
# use `error` to get the error from r
# use value The reason for not going with that syntax is that it doesn't combine bindings very well: without ((value1, error1) =? r1) and ((value2, error2) =? r2):
# is error1 set here?
# is error2 set here?
|
Nice! I like the syntax. Is it possible to leave out the |
LGTM, great job! Keen to know the answer to the above question as well, as I think it would be a good feature for backward compatibility. |
No worries, this is a backwards compatible change. The version of |
fwiw, a similar construct exists in the form of |
Yes, I've been able to make good use of
Thanks, I appreciate that! There's one thing that I haven't been able to do, and that is provide a |
I investigated the issue a bit further; turns out it didn't have anything to do with the mixin, but was triggered in a roundabout way by other test code. I filed an issue: arnetheduck/nim-results#21 |
Anything blocking this from being merged? |
Not anymore, I found a nasty bug that needed fixing, but that's been dealt with in 15e514d. I'll make a new release shortly. |
Supports
without
statements that provide access to the error in aResult
.Syntax: