in reply to Re^2: A proper name for is_sorted function that can check more than just sorting order?
in thread A proper name for is_sorted function that can check more than just sorting order?

Yes, you're quite right. I was thinking that is_ordered was better than is_sorted, because it would reflect some more general notion of order than just sorting order, but it is true that, for example, the $a->{end_date} eq $b->{start_date} example doesn't really have anything to do with order (even with a strongly customized idea of order).

But then, it is difficult to find a general name for that. Perhaps something like match_property or something in that direction would be better.

  • Comment on Re^3: A proper name for is_sorted function that can check more than just sorting order?
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: A proper name for is_sorted function that can check more than just sorting order?
by Dallaylaen (Chaplain) on Dec 25, 2017 at 23:48 UTC

    After reading this thread again, I'm thinking about a pair of names - seo-friendly is_sorted (or is_ordered) implying proximity to sort plus reduce_ok or similar that is for arbitrary checks. The implementation may be the same under the hood. There's no way to tell whether user supplied a total/partial order like gt/le or arbitrary structure check or mix of both.

    I'm also thinking about incorporating compound checks suggested by 1nickt via subtests, if Test::Builder allows me to (but it should).