Skip Menu |
Report information
Id: 131739
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: andynparker [at] googlemail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Andrew Parker <andynparker [...] googlemail.com>
Date: Tue, 11 Jul 2017 21:06:09 +0100
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
Subject: [BUG] - Writing an infix operator '>'.
Download (untitled) / with headers
text/plain 1.7k
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org