in reply to Reversed .= operator

Just create the operator:
> multi sub infix:<=.> (Str $w1 is rw, Str $w2) { $w1 = $w2 ~ $w1;} sub infix:<=.> (Str $w1 is rw, Str $w2) { #`(Sub+{Precedence}|14963240 +0) ... } > > my $c = "bar"; bar > $c =. "foo"; foobar > say $c; foobar
Oh, but I forgot to say, this is Perl 6, of course.

Sorry about it, I couldn't resist. ;-)

Replies are listed 'Best First'.
Re^2: Reversed .= operator
by raiph (Deacon) on May 03, 2016 at 06:26 UTC
      Thanks, raiph, I did not know about that reverse argument operator.
Re^2: Reversed .= operator
by 1nickt (Canon) on Apr 30, 2016 at 15:50 UTC

    So in other words, "Perl6" doesn't have it either.


    The way forward always starts with a minimal test.
      Nope, but it does not really need it either: it takes just one code line to define it.

      Take a look at Perl 6 without prejudice, I'm sure you'll love it.

        Take a look at Perl 6 without prejudice, I'm sure you'll love it.

        Do you use it for $work? If so, what type of work?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.