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
.first with a junction unexpectedly returns a junction (<a b c>.first: ‘a’|‘c’) #5681
Comments
From @AlexDanielDifferences between 2015.12 and HEAD: <AlexDaniel> committable6: 2015.12,HEAD <a b c d b e>.first(‘b’|‘a’).say <AlexDaniel> committable6: 2015.12,HEAD <a b c d b e>.first(‘b’|‘a’, :end).say In other words, .first used to return the first element even if you pass a junction as a parameter. Now it returns another junction. Bisectable points to this commit: rakudo/rakudo@157b46e <timotimo> we're really hoping to use a matcher there, i think IRC discussion originates here: http://irclog.perlgeek.de/perl6/2016-09-18#i_13233528 |
From @BenGoldberg1Here is a snippet from #perl6 on freenode: <BenGoldberg> m: ('a', 42, 'b', 22/7, 'c', 23).first(Int|Rat, :kv).say The result I expected was OUTPUT«(1 42)�» The docs say that the first argument for .first is Mu $matcher, and therefor autothreading should not happen. Rakudo implements .first using a couple of internal helper methods, !first-accepts and !first-accepts-end, located here: https://github.com/rakudo/rakudo/blob/641ee1e/src/core/Any-iterable-methods.pm#L1185 and Both of these helpers have a first argument of $test, which is untyped, and is therefor of type Any. Because of this, when either of these helper methods is called with a Junction, autothreading occurs. So, if you could add a couple of Mu�s, I�d appreciate it. Thanks, Ben Goldberg |
From @lizmatThis is a dup of #129304, which has been fixed with c78f5dc7df5b1398d2867 , tests needed.
|
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetTests added in Raku/roast@7cdeab4a68 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#129304 (status was 'resolved')
Searchable as RT129304$
The text was updated successfully, but these errors were encountered: