Skip to content
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 negative sizes (my @a[-9999999999999999]) #4816

Closed
p6rt opened this issue Dec 4, 2015 · 6 comments
Closed

Shaped arrays with negative sizes (my @a[-9999999999999999]) #4816

p6rt opened this issue Dec 4, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Dec 4, 2015

Migrated from rt.perl.org#126800 (status was 'resolved')

Searchable as RT126800$

@p6rt
Copy link
Author

p6rt commented Dec 4, 2015

From @AlexDaniel

Code for 32-bit system​:
my @​a[-9999999999999999]; say +@​a

Result​:
-9999999999999999

Woohoo! Array with negative size!

On 64-bit it is a bit more tricky​:
my @​a[-9223372036854775808,-2]; say +@​a

Result​:
-9223372036854775808

Just disallow negative numbers and that's it.

@p6rt
Copy link
Author

p6rt commented Mar 5, 2016

From @AlexDaniel

Oh, and don't forget about zeros. Zero has to be disallowed as well​:

Code​:
my @​a[0]; say @​a[0]

Result​:
Index 0 for dimension 1 out of range (must be 0..-1)
  in block <unit> at -e line 1

@p6rt
Copy link
Author

p6rt commented Apr 10, 2016

From @AlexDaniel

Fixed in rakudo/rakudo#737 , tests needed.

@p6rt
Copy link
Author

p6rt commented Apr 11, 2016

From @usev6

I added the above examples as tests to S02-types/array-shapes.t with commit Raku/roast@a2617480f4

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 11, 2016

From @usev6

I added the above examples as tests to S02-types/array-shapes.t with commit Raku/roast@a2617480f4

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Apr 11, 2016
@p6rt
Copy link
Author

p6rt commented Apr 11, 2016

@usev6 - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant