Skip to content

Commit

Permalink
Implement infix => operator for pair construction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Feb 6, 2010
1 parent 815a825 commit 73f7929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -1073,6 +1073,8 @@ token infix:sym<.=> { <sym> <O('%item_assignment, :nextterm<dottyopish>')> }

token infix_postfix_meta_operator:sym<=> { '=' <O('%item_assignment')> }

token infix:sym«=>» { <sym> <O('%item_assignment')> }

token prefix:sym<so> { <sym> >> <O('%loose_unary')> }
token prefix:sym<not> { <sym> >> <O('%loose_unary')> }

Expand Down
4 changes: 4 additions & 0 deletions src/core/operators.pm
Expand Up @@ -122,3 +122,7 @@ our multi infix:<min>(*@args) {
our multi infix:<max>(*@args) {
@args.max;
}

our multi infix=>»($key, $value) {
Pair.new(key => $key, value => $value);
}

0 comments on commit 73f7929

Please sign in to comment.