Skip to content

sort purity #3374

Closed
Closed
@jesse99

Description

@jesse99

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions