Skip to content
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

Sometimes, methods have different purity than corresponding functions #2754

Closed
catamorphism opened this issue Jun 29, 2012 · 4 comments
Closed
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@catamorphism
Copy link
Contributor

We ran into a problem where option::get is pure, but if you write foo.get(), it's considered impure, because the iface declaration doesn't mark anything "pure". There's a whole bunch of inconsistencies like this in option. More generally, a really simple form of purity inference would address this without having to do a bunch of tedious work.

@brson
Copy link
Contributor

brson commented Jun 29, 2012

Often the reason for this is the restriction on self type argument modes.

@brson
Copy link
Contributor

brson commented Jun 29, 2012

Where possible we should just delete the functions in favor of methods imo.

@bblum
Copy link
Contributor

bblum commented Jun 30, 2012

deleting functions in favour of methods would leave impure ones only.

@thestinger
Copy link
Contributor

pure is now fully removed from the language, closing this since #3080 is already open about unsafe on methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

4 participants