Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ff operator RHS always evaluates #3839

Open
fecundf opened this issue Aug 3, 2020 · 0 comments
Open

ff operator RHS always evaluates #3839

fecundf opened this issue Aug 3, 2020 · 0 comments

Comments

@fecundf
Copy link

fecundf commented Aug 3, 2020

The Problem

$start-expr ff $end-expr always evaluates $end-expr, giving surprising side-effects.

I expect that the left-hand side, the $start-expr, must be True before evaluating the right-hand side, the $end-expr.

The issue as I see it is that the $end-expr always runs, even before the $start-expr toggles the flip-fop on.

Steps to Reproduce, Sample code:

say 'ff side effect=', gather { False ff .take for 1..5 };
say 'fff side effect=', gather { False fff .take for 1..5 };

Expected Behavior

ff side effect=()
fff side effect=()

Actual Behavior

ff side effect=(1 2 3 4 5)
fff side effect=()

Environment

  • Operating system: OSX
    Tried this in two versions of Raku
  1. This is Rakudo version 2019.11 built on MoarVM version 2019.11 implementing Perl 6.d.
  2. This is Rakudo version 2020.07 built on MoarVM version 2020.07 implementing Raku 6.d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant