From: Martin DeMello Date: 2005-05-02T03:29:27+09:00 Subject: Re: collections with values of fixed classes/lengths Eric Mahurin wrote: > Here would be a few examples of what I'm talking about and how > much space per element it would take: > > - array of Floats (64 bits per element) > - array of N-bit integers (N bits per element) > - hash of 2-character strings (2*8 bits per key and Object per > value) > - array of array of 8 Floats (8*64 bits per line) > > For dealing with large data structures, this could be > invaluable for memory usage. I suspect the easiest way is to make a C extension (possibly copying code from Ruby's array.c and hash.c) that took in a datatype as an argument to its constructor and malloced etc. based on that. martin