Skip to content

Commit

Permalink
implement prefix +^ for integers
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jun 5, 2011
1 parent 53f404e commit 639f872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/CORE.setting/operators.pm
Expand Up @@ -143,3 +143,10 @@ multi infix:«+>»(Int \$a, Int \$b) {
pir::repr_unbox_int__ip($b)
));
}

proto prefix:<+^>(|$) { * }
multi prefix:<+^>(Int \$a) {
pir::perl6_box_int__PI(pir::bnot__II(
pir::repr_unbox_int__ip($a)
));
}
2 changes: 1 addition & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -127,7 +127,7 @@ class Perl6::Actions is HLL::Actions {

# Set HLL and load the needed libraries.
$outer.hll('perl6');
$unit.loadlibs('nqp_group', 'nqp_ops', 'perl6_group', 'perl6_ops');
$unit.loadlibs('nqp_group', 'nqp_ops', 'perl6_group', 'perl6_ops', 'bit_ops');

# If the unit defines &MAIN, add a &MAIN_HELPER.
my $mainparam := PAST::Var.new(:name('$MAIN'), :scope('parameter'),
Expand Down

0 comments on commit 639f872

Please sign in to comment.