Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by LanX (Saint)
on Dec 30, 2017 at 19:09 UTC ( [id://1206460]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1206460]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found