Skip to content

Commit

Permalink
Add infix:<minmax> operator -- resolves RT #66640.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jun 30, 2009
1 parent 7032827 commit a4978b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/parser/grammar-oper.pg
Expand Up @@ -162,17 +162,13 @@ proto infix:«p5=>» is equiv(infix:<,>) is subname('infix:,') { ... }
proto infix:<X> is precedence('f=')
is assoc('list')
{ ... }
# needs to come before the others because of missing LTM
proto infix:<...> is equiv(infix:<X>)
is assoc('list')
{ ... }
proto infix:<Z> is equiv(infix:<X>) { ... }
proto infix:<...> is equiv(infix:<X>) { ... }
proto infix:<minmax> is equiv(infix:<X>) { ... }
proto infix:<X,X> is equiv(infix:<X>)
is assoc('list')
is subname('infix:X')
{ ... }
proto infix:<Z> is equiv(infix:<X>)
is assoc('list')
{ ... }

## list assignment
proto infix:<=> is precedence('e=')
Expand Down
4 changes: 4 additions & 0 deletions src/setting/Operators.pm
Expand Up @@ -44,4 +44,8 @@ multi sub infix:<eqv> ($a, $b) {
die "infix:<eqv> is only implemented for certain special cases yet";
}

multi sub infix:<minmax>(@a, @b) {
(@a[0] min @b[0], @a[1] max @b[1]);
}

# vim: ft=perl6

0 comments on commit a4978b9

Please sign in to comment.