On Wed, Apr 21, 2004 at 11:04:56AM -0400, Simon Glover wrote: : Why? I was under the impression that in Perl 6 it was going to be : possible to declare arrays that only contain values of a particular : type -- I believe the syntax I saw was: : : my @array is float;
Just for the record, that's my num @array; You don't use "is" on any array unless you want to change the indexing policy (think "tie" in Perl 5). The standard "is Array" type knows how to deal with compactly stored low-level types as well as PMCs. The type you declare out front is the return type of a single array or hash element. The type you apply with "is" is the type of the array or hash as an aggregate. Most aggregate types are parameterized types based on the return type, if you think about it. In any event, it is absolutely my intent that the builtin array types of Perl 6 support PDL directly, both in terms of efficiency and flexibility. You ain't seen Apocalypse 9 yet, but that's what it's all about. Straight from my rfc list file: ch09/116 Efficient numerics with perl ch09/117.rr Perl syntax support for ranges ch09/122 types and structures ch09/123 Builtin: lazy ch09/124 Sort order for any hash ch09/136 Implementation of hash iterators ch09/142 Enhanced Pack/Unpack ch09/169.rr Proposed syntax for matrix element access and slicing. ch09/202 Arrays: Overview of multidimensional array RFCs (RFC 203 through RFC 207) ch09/203 Arrays: Notation for declaring and creating arrays ch09/204 Arrays: Use list reference for multidimensional array access ch09/205 Arrays: New operator ';' for creating array slices ch09/206 Arrays: @#arr for getting the dimensions of an array ch09/207 Arrays: Efficient Array Loops ch09/225 Data: Superpositions ch09/231 Data: Multi-dimensional arrays/hashes and slices ch09/247 pack/unpack C-like enhancements ch09/266 Any scalar can be a hash key ch09/268.rr Keyed arrays ch09/273 Internal representation of Pseudo-hashes using attributes. ch09/282 Open-ended slices ch09/341 unified container theory Larry