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

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

Thread Previous | Thread Next
From:
Larry Wall
Date:
July 26, 2020 17:04
Subject:
Re: Learning the "ff" (flipflop) infix operator? (was Re: Rakuversion of "The top 10 tricks... .")
Message ID:
20200726170431.GA22856@wall.org
On Sat, Jul 25, 2020 at 04:32:02PM -0500, Brad Gilbert wrote:
: In the above two cases ff and fff would behave identically.
: 
: The difference shines when the beginning marker can look like the end
: marker.

The way I think of it is this:  You come to the end of "ff" sooner, so you
do the end test immediately after passing the start test.  You come to the
end of "fff" later, so the end test is delayed to the next iteration from
the start test.  (Same mnemonic for .. and ... in Perl, by the way, since
ff and fff were modeled on .. and ... (in their scalar form), but we stole
.. and ... in Raku for ranges and sequences so we needed something else.)

I suppose if you're musical you can come up with mnemonics based on "fff"
being louder than "ff", so it echoes longer before it stops...  :)

Larry

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