in reply to A proper name for is_sorted function that can check more than just sorting order?

So, did you come to a conclusion? :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

  • Comment on Re: A proper name for is_sorted function that can check more than just sorting order?

Replies are listed 'Best First'.
Re^2: is_sorted - conclusions
by Dallaylaen (Chaplain) on Dec 30, 2017 at 22:32 UTC

    I think I'm staying with is_sorted for simple checks like $a < $b, plus a separate subtest-based function for more complex conditions, for which I don't have an established name yet:

    reduce_ok { is $a->{end_date}, $b->{start_date}, "reservations are coupled"; ok !$b->{is_arrival}, "not expecting >1 arrivals"; } \@reservations;

    The current implementation of is_sorted will work like that, too, but that's a coincidence and should not be abused.

    And happy new 2018!