Re: Ordinals, Hashes, and Arrays, oh my

2004-09-26 Thread Mark A. Biggar
Jonadab the Unsightly One wrote: Jonathan Lang [EMAIL PROTECTED] writes: ISAM? From the RDBMS world, a kind of index I think, or something along those lines. MySQL for example has a type of table called MyISAM. Index Sequential Access Method Invented by IBM in the '60s, provides fast random

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-25 Thread Uri Guttman
JtUO == Jonadab the Unsightly One [EMAIL PROTECTED] writes: JtUO Jonathan Lang [EMAIL PROTECTED] writes: ISAM? From the RDBMS world, a kind of index I think, or something along JtUO those lines. MySQL for example has a type of table called MyISAM. it predates dbms stuff. it stands

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-11 Thread Dan Schmidt
David Green wrote: That's true. But it's got me thinking about the connection between arrays and associative arrays. In fact, the user doesn't need to know that a hash is implemented with a hash table, and an array isn't; and nothing stops you from using numbers as hash keys. I believe Lua

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-11 Thread Larry Wall
On Fri, Sep 10, 2004 at 05:47:29PM -0600, David Green wrote: : On 2004/9/06, Larry Wall wrote: : : Another possibility is that .[] always forces the normal view of an : array as 0-based, and if you want non-0-based arrays you have to use : the .{} interface instead, on the assumption that strange

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-11 Thread Jonathan Lang
Larry Wall wrote: David Green wrote: : And if you restrict your hash to numeric keys, Perl could notice and : optimise it into an array. (Or integer keys, or positive integers, or : a consecutive range of positive ints) What exactly do you mean by could notice? The point about the

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-11 Thread Larry Wall
On Sat, Sep 11, 2004 at 02:16:50PM -0700, Jonathan Lang wrote: : Funny you should mention that, especially considering the (relatively) : recent discussion of revamping sort, and noting that providing an : ordering for a hash would essentially be the same as providing the hash : with a default

Ordinals, Hashes, and Arrays, oh my

2004-09-10 Thread David Green
On 2004/9/06, Larry Wall wrote: Another possibility is that .[] always forces the normal view of an array as 0-based, and if you want non-0-based arrays you have to use the .{} interface instead, on the assumption that strange subscripts are more like hash keys than ranges of integers. That's

Re: Ordinals, Hashes, and Arrays, oh my

2004-09-10 Thread David Green
On 2004/9/10, [EMAIL PROTECTED] (David Green) wrote: If we consider a generic data structure type (which may or may not be optimised under the hood for integral indices), then why shouldn't {} be the index-by-name interface, and [] the index-by-ordinal interface? (Does that mean [$x] is just a