chapel icon indicating copy to clipboard operation
chapel copied to clipboard

Rename default and reverse comparators in the sort module

Open jabraham17 opened this issue 7 months ago • 1 comments

This issue captures implementation information for decision made in https://github.com/chapel-lang/chapel/issues/24857

We are renaming the default comparators and removing the associated globals.

Tasks

  • [x] Remove const defaultComarator ..., replacement is new defaultComparator()
  • [x] Remove const reverseComarator ..., replacement is new reverseDefaultComparator()
  • [ ] Rename DefaultComparator to defaultComparator
  • [ ] Rename ReverseComparator to reverseComparator
  • [x] ~Add type reverseDefaultComparator = reverseComparator(defaultComparator);~
  • Add enum keyPartStatus with the following enum members
    • [x] returned
    • [x] pre
    • [x] post
  • [x] Rename defaultComparator.compare(a, b) to defaultComparator.compare(x, y: x.type)
  • [x] Rename reverseComparator.compare(a, b) to reverseComparator.compare(x, y: x.type)
  • [x] Rename TwoArrayDistSortPerBucketTaskStartComparator.key(arg ... to TwoArrayDistSortPerBucketTaskStartComparator.key(elt ...
    • this is an internal implementation detail and will not require a deprecation
  • [x] Convert all keyPart methods to the new style
    • proc keyPart(elt, i: int): (keyPartStatus, integral)

jabraham17 avatar Jul 12 '24 20:07 jabraham17