develooper Front page | perl.perl6.users | Postings from August 2020

Re: Learning the "ff" (flipflop) infix operator? (was Re: Rakuversion of "The top 10 tricks... .")

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
August 2, 2020 21:42
Subject:
Re: Learning the "ff" (flipflop) infix operator? (was Re: Rakuversion of "The top 10 tricks... .")
Message ID:
CAHAeAG4zoOshgyAr69Vs00oF+ob7iB=q0wXxVZ7r8Jw4tnckCw@mail.gmail.com
On Sun, Aug 2, 2020 at 11:14 PM yary <not.com@gmail.com> wrote:

> Issue golf, ff is always evaluating its RHS
>
> $ raku -e 'say "With ff: ";say ( 1..5 ).grep({False ff .say}); say "With
> fff: ";say ( 1..5 ).grep({False fff .say});'
> With ff:
> 1
> 2
> 3
> 4
> 5
> ()
> With fff:
> ()
>

  I haven't looked much at Raku since it was Perl6, but for comparison,
here's some Perl 5:

$ perl -E 'say "With ..: ";say grep {/nope/ .. say} 1..5; say "With ...:
";say grep {/nope/ ... say} 1..5;'
With ..:

With ...:


Eirik

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About