Skip to content

Commit

Permalink
implement some string bitwise ops
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jun 5, 2011
1 parent 04b1572 commit b504ad2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/CORE.setting/operators.pm
Expand Up @@ -120,6 +120,36 @@ multi infix:<leg>(Str \$a, Str \$b) {
1;
}

proto infix:<~|>(|$) { * }
multi infix:<~|>(Str \$a, Str \$b) {
pir::perl6_box_str__PS(pir::bors__SSS(
pir::repr_unbox_str__SP($a),
pir::repr_unbox_str__SP($b),
));

}

proto infix:<~&>(|$) { * }
multi infix:<~&>(Str \$a, Str \$b) {
pir::perl6_box_str__PS(pir::bands__SSS(
pir::repr_unbox_str__SP($a),
pir::repr_unbox_str__SP($b),
));
}

proto infix:<~^>(|$) { * }
multi infix:<~^>(Str \$a, Str \$b) {
pir::perl6_box_str__PS(pir::bxors__SSS(
pir::repr_unbox_str__SP($a),
pir::repr_unbox_str__SP($b),
));
}

proto prefix:<~^>(|$) { * }
multi prefix:<~^>(Str \$a) {
pir::perl6_box_str__PS(pir::bnots__SS(pir::repr_unbox_str__SP($a)));
}

proto infix:<+|>(|$) { * }
multi infix:<+|>(Int \$a, Int \$b) {
pir::perl6_box_int__PI(pir::bor__III(
Expand Down

0 comments on commit b504ad2

Please sign in to comment.