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 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 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 16:15:33, david.warring wrote:
> > > This is OK:
> > >
> > > % perl6 -e'my $size = 2; my @xref[$size,3] = ([1,2,3], [4,5,6]); say
> > @xref'
> > >
> > > [[1 2 3] [4 5 6]]
> > >
> > > But this isn't:
> > >
> > > % perl6 -e'my $size = 0; my @xref[$size,3] = (); say @xref'
> > >
> > > Illegal dimension in shape: 0. All dimensions must be integers bigger
> > than
> > > 0
> > > in block <unit> at -e line 1
> > >
> > > % perl6 -v
> > > This is Rakudo version 2017.08 built on MoarVM version 2017.08.1
> > > implementing Perl 6.c.
> > >
> > > Just seems an unreasonable restriction that the major shape size of an
> > > array can't be zero.
> >
> >
>
>

Reply via email to