Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 42 additions and 14 deletions. Show diff stats Hide diff stats

  1. +41 13 src/core/Str.pm
  2. +1 1  tools/build/NQP_REVISION
54 src/core/Str.pm
@@ -473,62 +473,90 @@ my class Str does Stringy {
473 473 }
474 474
475 475
476   -multi prefix:<~>(Str:D \$a) { $a }
  476 +multi prefix:<~>(Str:D \$a) returns Str:D { $a }
  477 +multi prefix:<~>(str $a) returns str{ $a }
477 478
478   -multi infix:<~>(Str:D \$a, Str:D \$b) {
  479 +multi infix:<~>(Str:D \$a, Str:D \$b) returns Str:D {
479 480 nqp::p6box_s(nqp::concat_s(nqp::unbox_s($a), nqp::unbox_s($b)))
480 481 }
  482 +multi infix:<~>(str $a, str $b) returns str { nqp::concat_s($a, $b) }
481 483
482   -multi infix:<x>(Str:D $s, Int:D $repetition) {
  484 +multi infix:<x>(Str:D $s, Int:D $repetition) returns Str:D {
483 485 $repetition <= 0
484 486 ?? ''
485 487 !! nqp::p6box_s(nqp::x(nqp::unbox_s($s), nqp::unbox_i($repetition)))
486 488 }
  489 +multi infix:<x>(str $s, int $repetition) returns str {
  490 + $repetition <= 0 ?? '' !! nqp::x($s, $repetition);
  491 +}
487 492
488   -multi infix:<cmp>(Str:D \$a, Str:D \$b) {
  493 +multi infix:<cmp>(Str:D \$a, Str:D \$b) returns Int:D {
489 494 nqp::p6box_i(nqp::cmp_s(nqp::unbox_s($a), nqp::unbox_s($b)))
490 495 }
  496 +multi infix:<cmp>(str $a, str $b) returns int { nqp::cmp_s($a, $b) }
491 497
492   -multi infix:<===>(Str:D \$a, Str:D \$b) {
  498 +multi infix:<===>(Str:D \$a, Str:D \$b) returns Bool:D {
493 499 nqp::p6bool(nqp::iseq_s(nqp::unbox_s($a), nqp::unbox_s($b)))
494 500 }
  501 +multi infix:<===>(str $a, str $b) returns Bool:D {
  502 + nqp::p6bool(nqp::iseq_s($a, $b))
  503 +}
495 504
496   -multi infix:<leg>(Str:D \$a, Str:D \$b) {
  505 +multi infix:<leg>(Str:D \$a, Str:D \$b) returns Int:D {
497 506 nqp::p6box_i(nqp::cmp_s(nqp::unbox_s($a), nqp::unbox_s($b)))
498 507 }
  508 +multi infix:<leg>(str $a, str $b) returns int { nqp::cmp_s($a, $b) }
499 509
500   -multi infix:<eq>(Str:D \$a, Str:D \$b) {
  510 +multi infix:<eq>(Str:D \$a, Str:D \$b) returns Bool:D {
501 511 nqp::p6bool(nqp::iseq_s(nqp::unbox_s($a), nqp::unbox_s($b)))
502 512 }
  513 +multi infix:<eq>(str $a, str $b) returns Bool:D {
  514 + nqp::p6bool(nqp::iseq_s($a, $b))
  515 +}
503 516
504 517 multi infix:<lt>(Str:D \$a, Str:D \$b) {
505 518 nqp::p6bool(nqp::islt_s(nqp::unbox_s($a), nqp::unbox_s($b)))
506 519 }
  520 +multi infix:<lt>(str $a, str $b) returns Bool:D {
  521 + nqp::p6bool(nqp::islt_s($a, $b))
  522 +}
507 523
508   -multi infix:<le>(Str:D \$a, Str:D \$b) {
  524 +multi infix:<le>(Str:D \$a, Str:D \$b) returns Bool:D {
509 525 nqp::p6bool(nqp::isle_s(nqp::unbox_s($a), nqp::unbox_s($b)))
510 526 }
  527 +multi infix:<le>(str $a, str $b) returns Bool:D {
  528 + nqp::p6bool(nqp::isle_s($a, $b))
  529 +}
511 530
512   -multi infix:<gt>(Str:D \$a, Str:D \$b) {
  531 +multi infix:<gt>(Str:D \$a, Str:D \$b) returns Bool:D {
513 532 nqp::p6bool(nqp::isgt_s(nqp::unbox_s($a), nqp::unbox_s($b)))
514 533 }
  534 +multi infix:<gt>(str $a, str $b) returns Bool:D {
  535 + nqp::p6bool(nqp::isgt_s($a, $b))
  536 +}
515 537
516   -multi infix:<ge>(Str:D \$a, Str:D \$b) {
  538 +multi infix:<ge>(Str:D \$a, Str:D \$b) returns Bool:D {
517 539 nqp::p6bool(nqp::isge_s(nqp::unbox_s($a), nqp::unbox_s($b)))
518 540 }
  541 +multi infix:<le>(str $a, str $b) returns Bool:D {
  542 + nqp::p6bool(nqp::isle_s($a, $b))
  543 +}
519 544
520 545
521 546 multi infix:<~|>(Str:D \$a, Str:D \$b) {
522   - nqp::p6box_s(pir::bors__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  547 + nqp::p6box_s(nqp::bitor_s(nqp::unbox_s($a), nqp::unbox_s($b)))
523 548 }
  549 +multi infix:<~|>(str $a, str $b) { nqp::bitor_s($a, $b) }
524 550
525 551 multi infix:<~&>(Str:D \$a, Str:D \$b) {
526   - nqp::p6box_s(pir::bands__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  552 + nqp::p6box_s(nqp::bitand_s(nqp::unbox_s($a), nqp::unbox_s($b)))
527 553 }
  554 +multi infix:<~&>(str $a, str $b) { nqp::bitand_s($a, $b) }
528 555
529 556 multi infix:<~^>(Str:D \$a, Str:D \$b) {
530   - nqp::p6box_s(pir::bxors__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  557 + nqp::p6box_s(nqp::bitxor_s(nqp::unbox_s($a), nqp::unbox_s($b)))
531 558 }
  559 +multi infix:<~^>(str $a, str $b) { nqp::bitxor_s($a, $b) }
532 560
533 561 multi prefix:<~^>(Str \$a) {
534 562 fail "prefix:<~^> NYI"; # XXX
2  tools/build/NQP_REVISION
... ... @@ -1 +1 @@
1   -2011.10-53-g7e4bb20
  1 +2011.10-54-g4bc5cae

No commit comments for this range

Something went wrong with that request. Please try again.