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
Can't implicitly numify Failure in Rakudo #1904
Comments
From @masak<masak> rakudo: say "abcd".index("xyz") == 0 Might be that comparing Failure (or any non-numeric type object, for |
From @masakAs colomon++ pointed out, this works: <masak> rakudo: say +Failure So it's rather any *implied* numification that fails. |
@masak - Status changed from 'new' to 'open' |
From @cokeOn Wed Jun 30 07:48:56 2010, masak wrote:
It now warns: 00:43 < [Coke]> rakudo: say "abcd".index("xyz") == 0 -- |
From @cokeOn Mon Sep 19 21:43:52 2011, coke wrote:
Current behavior:
-- |
From @usev6Now all three commands complain about a type object being passed when an instance is required: $ perl6 -e 'say +Failure' $ perl6 -e 'say "abcd".index("xyz") == 0' $ perl6 -e 'Failure == 0' Is that reasonable or what would be an adequate error message? |
1 similar comment
From @usev6Now all three commands complain about a type object being passed when an instance is required: $ perl6 -e 'say +Failure' $ perl6 -e 'say "abcd".index("xyz") == 0' $ perl6 -e 'Failure == 0' Is that reasonable or what would be an adequate error message? |
From @lizmat
.index is speculated to return a StrPos object: "The value returned is always a C<StrPos> object. If the substring This would imply it should not fail, but return True *and* give a warning!
My feeling is that these should fail. Failure’s are supposed not be thrown only when being checked for definedness. Making it a number, does not meet that criterion in my opinion. Liz |
From @cokeOn Mon Mar 16 13:13:35 2015, elizabeth wrote:
StrPos is gone from the design docs, so this needs to be revisited. -- |
It's now a warning:
Which is thrown by Nil: So I would say this issue is solved now. |
Migrated from rt.perl.org#76294 (status was 'open')
Searchable as RT76294$
The text was updated successfully, but these errors were encountered: