Thanks, that's cool, and shows me something I was wondering about

On Tue, Sep 1, 2020 at 11:36 AM Larry Wall <la...@wall.org> wrote:

> If you want to re-initialize a state variable, it's probably better to make
> it explicit with the state declarator:
>
>     $ raku -e "for <a b> { for (1..2) { say (state $ = 'AAA')++ } }"
>     AAA
>     AAB
>     AAA
>     AAB
>

$ raku -e 'for <AA OO> -> $alpha { for (1..3) { say (state $ = $alpha)++ }
}'
AA
AB
AC
OO
OP
OQ

Reply via email to