Skip to content

Add wrapper macros from other error modes to options #9163

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

Closed
wants to merge 4 commits into from

Conversation

PMunch
Copy link
Contributor

@PMunch PMunch commented Oct 3, 2018

This adds three simple macros that wraps a procedure that fails with an error code, or one that throws an exception, into one that returns an option instead. Useful if one wants to utilise other things in the options module, or mix libraries with different error modes.

Depends on PR #9160

@Araq
Copy link
Member

Araq commented Oct 11, 2018

We will get performance complaints about these macros since they introduce anon procs that capture variables.

@PMunch
Copy link
Contributor Author

PMunch commented Oct 11, 2018

Yeah I was thinking about that, but couldn't think of a way to do it without them. Do you have any tricks to make that work?

@narimiran
Copy link
Member

Now we have optionsutils package which implements all the features proposed in this PR. Closing.

@narimiran narimiran closed this Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants