Skip Menu |
Report information
Id: 130721
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: jdv79 <justin [at]>

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)

To: <rakudobug [...]>
Subject: [BUG] .? differs from . but meth exists
From: Justin DeVuyst <justin [...]>
Date: Sun, 05 Feb 2017 16:21:51 -0500
Download (untitled) / with headers
text/plain 318b
[jdv@new-host-2 ~]$ perl6 -e '(<a b>, <c d e>).values>>.elems.say' (2 3) [jdv@new-host-2 ~]$ perl6 -e '(<a b>, <c d e>).values>>.?elems.say' ((1 1) (1 1 1)) [jdv@new-host-2 ~]$ perl6 -v This is Rakudo version 2017.01-170-gc0a907f built on MoarVM version 2017.01-31-g20dfa6b implementing Perl 6.c. [jdv@new-host-2 ~]$
Download (untitled) / with headers
text/plain 541b
The reason ».elems doesn't descend into the sub-lists, is that the `elems` method is declared with the `is nodal` trait, as described in S03 [1]. The design docs on the `.?` method call form [2] don't explicitly say whether it should also respect nodality when used with the hyper operator like this, but it seems reasonable to expect that `.?` and `.` would behave identically when the method exists. --- [1] [2]

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at