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
inconsistent coercions for Bool #4924
Comments
From zefram@fysh.orgI'm not sure what identities we can expect coercions to obey in Perl 6,
The two coercions are surprisingly inconsistent. In both cases the output Furthermore, in this case the input value is already of both of the The Numeric coercion shown above is also inconsistent with what is
The coercion that looks inconsistent with the others and with common -zefram |
From @lizmatFixed with a4140a3 , tests needed
|
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetTests added in Raku/roast@d0f8198 |
@zoffixznet - Status changed from 'open' to 'resolved' |
From @skidsOn Wed, 17 Aug 2016 09:03:15 -0700, cpan@zoffix.com wrote:
There is still the matter of Numeric() in a signature. However since: $ perl6 -e 'my Numeric() $a;' ... one wonders what the fate of Numeric() is. WRT to the subject of what .Numeric/.Real/.Int/etc do (long screed Here's how I construe the reasoning for the decision to Casts to the Numeric/Real *roles* are used in the arithmetic Trying to fit type calculus onto the arithmetic system is Enums, horribly, happen fall into both categories: they Finally you have use cases both for defining narrower The current system is only good for the latter, and allows For classes that do not have the Numeric role, the .Numeric In the case of enums, where you have extra data attached, The current behavior allows enum and IntStr appear to behave Now, a good case might be made that really Perl6 should have This is more grating to FP adherents in the case of BTW, I'd argue this should also work here where it doesn't, my $a = 5 but "foo"; $a.Numeric.Str.say; # Should probably say "5" Something in the future needs to be done for the former case For more complex things like logging/Proxy classes where interim Efficiency concerns will come up with any of that. I think the |
Migrated from rt.perl.org#127019 (status was 'resolved')
Searchable as RT127019$
The text was updated successfully, but these errors were encountered: