# New Ticket Created by
# Please include the string: [perl #131739]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=131739 >
Guys,
Here is a one liner to illustrate a possible bug trying to redefine the
operator '>' and I think any other operator with the '<' or '<'
characters.
perl6 -e 'multi infix:«>»( $left, $right --> Bool) is
equiv(&infix:«>») { ... }'
===SORRY!=== Error while compiling -e
Routine given to equiv does not appear to be an operator
at -e:1
I think the error lies here in SETTINGS:
# next three sub would belong to traits.pm if PseudoStash were
available
# so early in the setting compunit
multi sub trait_mod:<is>(Routine $r, Str :$equiv!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~
nqp::escape($equiv) ~ '>';
trait_mod:<is>($r, equiv => ::(nm));
return;
}
die "Routine given to equiv does not appear to be an operator";;
}
multi sub trait_mod:<is>(Routine $r, Str :$tighter!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~
nqp::escape($tighter) ~ '>';
trait_mod:<is>($r, tighter => ::(nm));
return;
}
die "Routine given to tighter does not appear to be an operator";;
}
multi sub trait_mod:<is>(Routine $r, Str :$looser!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~
nqp::escape($looser) ~ '>';
trait_mod:<is>($r, looser => ::(nm));
return;
}
die "Routine given to looser does not appear to be an operator";;
Using:
perl6 -version
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.
OS is Fedora 24.
Regards,
Andrew N Parker