Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Quick implementations of infix:<min> and infix:<max> (using before an…
…d after).
  • Loading branch information
colomon committed Feb 4, 2010
1 parent e36d988 commit 6bc10e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -1054,6 +1054,8 @@ token infix:sym<&&> { <sym> <O('%tight_and, :pasttype<if>')> }
token infix:sym<||> { <sym> <O('%tight_or, :pasttype<unless>')> }
token infix:sym<^^> { <sym> <O('%tight_or, :pasttype<xor>')> }
token infix:sym<//> { <sym> <O('%tight_or, :pasttype<def_or>')> }
token infix:sym<min> { <sym> <O('%tight_or')> }
token infix:sym<max> { <sym> <O('%tight_or')> }

token infix:sym<?? !!> {
'??'
Expand Down
8 changes: 8 additions & 0 deletions src/core/operators.pm
Expand Up @@ -110,3 +110,11 @@ our multi infix:<?&>($a, $b) {
our multi infix:<?^>($a, $b) {
?pir::bxor__III($a, $b)
}

our multi infix:<min>($a, $b) {
$a before $b ?? $a !! $b;
}

our multi infix:<max>($a, $b) {
$a after $b ?? $a !! $b;
}

0 comments on commit 6bc10e4

Please sign in to comment.