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
Shaped arrays with fractional sizes (my @a[0.5]) #4817
Comments
From @AlexDanielMy previous bug report was about overflow associated with negative sizes This time it is a little bit different: Result: Actually, it only accepts values that can unbox to a native integer. “0.5” That being said, I think sometimes it could be useful to create an array if Interestingly, it is not only about “-1” sneaking in: Result: Perhaps it should just round it down to an integer internally? … but why <AlexDaniel> TimToady: “my @a[5.5]” – what should it mean? [5], [6] or Well, hmm… Go figure! |
From @AlexDanielThe first part of the ticket was resolved in rakudo/rakudo@46dca95 So you can no longer create an array using 0.5. But you can still create an array with any fractional value that's larger than 1, and it will blow up later. ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ The commit mentioned above gives a clue on what part of the code can be changed to resolve the issue. https://github.com/rakudo/rakudo/blob/cef3bf3e75411a5a664f93ea72209637eaaf5e3d/src/core/Rakudo/Internals.pm#L357-L362 I *think* that calling .Int on it will resolve the issue, but this of course won't produce a Failure which was recommended by TimToady. Either way the issue should be easy to approach. On 2015-12-03 19:32:19, alex.jakimenko@gmail.com wrote:
|
Migrated from rt.perl.org#126802 (status was 'new')
Searchable as RT126802$
The text was updated successfully, but these errors were encountered: