# New Ticket Created by Bob Rogers # Please include the string: [perl #52778] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=52778 >
As the transcript below shows, Parrot out-Perls even Perl by changing the array length when accessing a non-existent element, and not just when storing one. It would be easy enough to give Parrot the same behavior as Perl, but it's not clear that that's entirely the right thing. The real question is therefore: What's the appropriate autovivification behavior for the resizable array base classes, which presumably ought to be language-agnostic? -- Bob Rogers http://rgrjr.dyndns.org/ ------------------------------------------------------------------------ [EMAIL PROTECTED]> cat array-autoviv.pl #! /usr/bin/perl -w my @array; print $array[7] || ''; print scalar(@array), "\n"; [EMAIL PROTECTED]> ./array-autoviv.pl 0 [EMAIL PROTECTED]> cat array-autoviv.pir .sub main :main .local pmc array array = new 'ResizablePMCArray' $P0 = array[7] $I0 = array print $I0 print "\n" .end [EMAIL PROTECTED]> ./parrot array-autoviv.pir 8 [EMAIL PROTECTED]>