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

Confused after consuming hashish

Thread Next
July 7, 2022 02:54
Confused after consuming hashish
Message ID:

This is sharing a 'What?!!' moment and some aftermath with the
hope of some reduction of ignorance.

This is from some code I found:

    say my %h = % = %(:a(1));       # OUTPUT: «{a => 1}␤»

All whitespace after the identifier is optional--not changing the

Reduced further:

    say % = %(:a(1));              # OUTPUT: «{a => 1}␤»

I don't know what the free-standing '%' means; my guess is that
it accepts the result of the assign-op as a term.  So it is the
same as the last '%'.

Is that correct?  Correct as Raku code and as what is happening.

Why, in the ' %= ' variant, is neither of these failing?
Is it not ambiguous with the '%=' operator?

And I found that '%=' is also indexed in the docs as a twigil,
but it is not in the docs.  Is i

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About