Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypered conditional method calls ».?foo don't respect nodal methods #6058

Closed
p6rt opened this issue Feb 5, 2017 · 5 comments
Closed

Hypered conditional method calls ».?foo don't respect nodal methods #6058

p6rt opened this issue Feb 5, 2017 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 5, 2017

Migrated from rt.perl.org#130721 (status was 'resolved')

Searchable as RT130721$

@p6rt
Copy link
Author

p6rt commented Feb 5, 2017

From @jdv

[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 ~]$

@p6rt
Copy link
Author

p6rt commented Feb 5, 2017

From @smls

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] https://design.perl6.org/S03.html#Structural_unary_hyper_operators
[2] https://design.perl6.org/S12.html#Calling_sets_of_methods

@p6rt
Copy link
Author

p6rt commented Feb 5, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 29, 2017

From @zoffixznet

On Sun, 05 Feb 2017 13​:22​:13 -0800, jdv79 wrote​:

[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 ~]$

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@3c4041eab5eaedb
Test​: Raku/roast@868491aaf5333c246

@p6rt
Copy link
Author

p6rt commented Oct 29, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 29, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant