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
From:
yary
Date:
August 3, 2020 21:46
Subject:
Re: Learning the "ff" (flipflop) infix operator? (was Re: Rakuversion of "The top 10 tricks... .")
Message ID:
CAG2CFAYQJRjuiDtsFHZE51VQLZaRAWq3huYU4fNNCGZ0_Y-Xgg@mail.gmail.com
I opened a Raku ticket https://github.com/rakudo/rakudo/issues/3839
-y


On Sun, Aug 2, 2020 at 5:42 PM Eirik Berg Hanssen <
Eirik-Berg.Hanssen@allverden.no> wrote:

> 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


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