Advertisement
Guest User

Untitled

a guest
Aug 13th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.         my &cmp := &by.arity == 2 ?? &by !! { $^a cmp $^b };
  3.         my Bool $is-initialized = False;
  4.         for @values {
  5.             if $is-initialized {
  6.                 $min = $_ if cmp($_, $min) < 0;
  7.             } else {
  8.                 if .defined {
  9.                     $min = $_;
  10.                     $is-initialized = True;
  11.                 }
  12.             }
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement