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
multi subs with inconsistent where clauses don't work correctly #6109
Comments
From @b2gillsThis prints the numbers 1 to 9 then fails with a constraint error my \one-out-of-ten = (|(False,False,False,False,False,False,False,False,False,True) xx *).iterator; multi sub rarely ( $_ where one-out-of-ten.pull-one ){ say "test $_"; nextsame} (1..100).map: &rarely; If I switch it so that it usually matches it doesn't fail my \nine-out-of-ten = (|(False,True,True,True,True,True,True,True,True,True) xx *).iterator; multi sub often ( $_ where nine-out-of-ten.pull-one ){ say "test $_"; nextsame } (1..100).map: &often; It does seem as if the constraint is being called twice The reason I stumbled across this I thought something like this |
From @timoI'd say this is NOTABUG via the DIHWIDT category. If your where clause If you're fine with relying on internals, you can just put True into the test 90 We rely on binding a signature to give the same result multiple times in I'm not entirely sure why it gives you "Constraint type check failed for Zoffix wrote a bit of code on IRC that demonstrates "inconsistent bind perl6 -e 'my Hope that clears things up! BTW, for a fun time, put a "say 'here'" into a where clause and count |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Tue, 28 Feb 2017 05:54:51 -0800, timo wrote:
Closing this per comments above. I've committed a note into the docs to clarify side-effects from where clauses aren't meant to work: Raku/doc@3ed1803 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#130886 (status was 'resolved')
Searchable as RT130886$
The text was updated successfully, but these errors were encountered: