Hi,

I think Ruby NArray has about the same efficiency as the new array/tuple
that you describe, although it seems that NArray does not have an explicit
push method.

Regards,

Bill
============================================================================
MikkelFJ <mikkelfj-anti-spam / bigfoot.com> wrote:
> I was rethinking this. I'm not sure tuples would make any difference
> compared to Rubys current arrays. It's more a question of ensuring that Ruby
> internally handles small arrays efficiently:
> [1,2,3] should be allocated in memory like <type=small-array, size=3, 1, 2,
> 3>. I.e. approximately the same overhead as floating values. Once a small
> array is mutated with push etc. they could be converted into a  more generic
> array datatype internally. I don't know how it currently works, but I think
> the current array type is sufficient.