Re: [perl #131965] Shaped arrays can't have zero size

2017-08-27 Thread David Warring via RT
Attached is my use case which is parsing of PDF cross reference indices. There are normally three numeric entries per line. e.g. xref 0 8 00 65535 f 09 0 n 74 0 n 000120 0 n Which populates nicely into an array of 'n' lines of shape 3. There's the rare,

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-27 Thread David Warring
Attached is my use case which is parsing of PDF cross reference indices. There are normally three numeric entries per line. e.g. xref 0 8 00 65535 f 09 0 n 74 0 n 000120 0 n Which populates nicely into an array of 'n' lines of shape 3. There's the rare,

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery via RT
> Well, what do you mean? Of course you can't put anything into it, and any > attempt to index it will throw. It may seem useless, however, if you can > have > an empty array, why can't you have a shaped empty array? > Only if all dimensions are unindexable. Otherwise you have something with

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery
> Well, what do you mean? Of course you can't put anything into it, and any > attempt to index it will throw. It may seem useless, however, if you can > have > an empty array, why can't you have a shaped empty array? > Only if all dimensions are unindexable. Otherwise you have something with

[perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Well, what do you mean? Of course you can't put anything into it, and any attempt to index it will throw. It may seem useless, however, if you can have an empty array, why can't you have a shaped empty array? On 2017-08-26 17:13:02, allber...@gmail.com wrote: > How exactly do you index such an

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery
How exactly do you index such an array? On Sat, Aug 26, 2017 at 8:11 PM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > Indeed. The limit was introduced as a response to this ticket: > https://rt.perl.org/Ticket/Display.html?id=126800 > The check is probably too

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery via RT
How exactly do you index such an array? On Sat, Aug 26, 2017 at 8:11 PM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > Indeed. The limit was introduced as a response to this ticket: > https://rt.perl.org/Ticket/Display.html?id=126800 > The check is probably too

[perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Indeed. The limit was introduced as a response to this ticket: https://rt.perl.org/Ticket/Display.html?id=126800 The check is probably too aggressive, and indeed, maybe there's nothing wrong with 0 sized arrays. I wonder what was the justification for making the check inclusive. On 2017-08-26

[perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread via RT
# New Ticket Created by David Warring # Please include the string: [perl #131965] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131965 > This is OK: % perl6 -e'my $size = 2; my @xref[$size,3] = ([1,2,3], [4,5,6]); say