develooper Front page | perl.perl6.users | Postings from December 2018

Pair colon-chains

Thread Next
From:
yary
Date:
December 25, 2018 00:22
Subject:
Pair colon-chains
Message ID:
CAG2CFAYAXnNvsNKivnyLk0c6nR-agQ+3LSeMSUk86isW5tzNWA@mail.gmail.com
https://docs.perl6.org/type/Pair says "Colon pairs can be chained without a
comma to create a List of Pairs. Depending on context you may have to be
explicit when assigning colon lists." - and follows with examples, which
led me to experiments, that raise more questions. I would think all 5 of
these should say the same thing but instead give 3 different answers. Does
the doc need an addition to describe this? Is it a problem with Rakudo Star
2018.10?

$ perl6

To exit type 'exit' or '^D'

> (:a1:b2:c3)

(a1 => True b2 => 1 c3 => 1)

> (:a1,:b2,:c3)

(a1 => True b2 => True c3 => True)

> :a1,:b2,:c3

(a1 => True b2 => True c3 => True)

> :a1:b2:c3

a1 => True

> :a1 :b2 :c3

a1 => True



-y

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About