Hello,

I'm trying to learn the "ff" (flipflop) infix operator, generally
taking examples from the docs (below):

https://docs.raku.org/routine/ff

I tried adding in an "m:1st" adverb and an "m:2nd" adverb, but the
output isn't what I expect with the "m:2nd" adverb (examples #3 and
#5):

say "\n1. ----";
for <AB C D B E F> {
    say $_ if /A/ ff /B/;  # OUTPUT: «AB␤»
}

say "\n2. ----";
#mine
for <AB C D B E F> {
    say $_ if /A/ ff m:1st/B/;  # OUTPUT: «AB␤»
}

say "\n3. ----";
#mine
for <AB C D B E F> {
    say $_ if /A/ ff m:2nd/B/;  # OUTPUT: «AB␤C␤D␤B␤E␤F␤»
}

say "\n4. ----";
for <AB C D B E F> {
    say $_ if /C/ ff *;    # OUTPUT: «C␤D␤B␤E␤F␤»
}

say "\n5. ----";
#mine
for <AB C D B E F> {
    say $_ if m:2nd/B/ ff *;    # OUTPUT: blank
}

I'm wondering if I'm using the correct "flipflop" operator, since
"ff", "ff^", "fff", and "fff^" are all provided in Raku.

Any assistance appreciated, Bill.

Reply via email to