Also, you may want to use the divisibility operator %% instead of modulo. I
think
    if $i %% 2
Is clearer to read.

On Sat, Nov 30, 2019, 16:28 Timo Paulssen <t...@wakelift.de> wrote:

>
> On 30/11/2019 09:05, ToddAndMargo via perl6-users wrote:
> > One of the weirdest was
> >
> > for @Result.kv -> $I, $Line {
> >    if $I % 2 = 0
> >
> > being told I could not change an immutable object.
>
>
> Here you're trying to assign 0 to the result of $I % 2, if that's
> actually exactly the code. You want to compare here, not assign, i.e.
> use == instead of =
>
> HTH
>   - Timo
>

Reply via email to