It depends on how you define "array" and "generic." As for the array, there are two cases that need to be considered separately:
- Fixed arrays (declared
my @a[$size]
); this includes multidimensional arrays with fixed sizes (for example, my @a[$xs, $ys]
). They have the interesting property that the memory supporting them should never change. - (
my @a
), . , .
, :
- , , , - concurrency . " ", .
- , - . , .
- / ( , , , , , , ).
:
| Fixed size | Variable size |
---------------------+----------------+---------------+
Read-only, non-lazy | Safe | Safe |
Read/write or lazy | Safe * | Not safe |
*, , , Perl 6, , , , .
, , , " " ( , ). , , , , ( , ). , .
, , , my @copy;
my @length;
, . , .
, , , gory.