-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
sort purity #3374
Comments
Note that the work around is to use an unsafe block in the comparison function. |
Yeah, the Closing this as it's intended behavior. Also note, this is not substantial enough an issue to warrant the RFC tag. |
You can't write to anything (This is allowed intentionally, right?)
|
I'm... not sure that's by design. I want to tighten up and reformulate the purity rules in a more principled way. I will open a separate issue and throw in this example. |
See #3490 |
The sort functions currently require a pure comparison function. Is this actually required?
For example, I need to be able to sort the results of a query where the results are not always orderable. If the comparison functions are allowed to be impure then I can add a
err: @mut ~str
argument to my function and see if it is set when the sort finishes. But if purity is required then I'll need to do a pass before the sort which is a) duplicating a traversal that sort has to do anyway and b) very inefficient (especially given that queries can have lots of results).The text was updated successfully, but these errors were encountered: