From: MikkelFJ Date: 2002-09-29T06:29:30+09:00 Subject: Re: Where Is Method Call Precedence? "Gavin Sinclair" wrote in message news:045901c266f5$19ba5de0$845186cb@nosedog... > > ----- Original Message ----- > From: "MikkelFJ" > > > > > > Tuples are very powerful datastructures in OCaml. They are not lists and > > they are not arrays. They do, for example, make it much easier to handle > > values in parser reductions. In Ruby you would use arrays or hashes, but > > they have a much higher overhead. It would be nice with tuples in Ruby. > > > > Mikkel > > > > Since Ruby is close to Python is *some* ways, and Python has tuples, I cast the > question: "What are tuples used for in Python?". If someone answers that, then > I would get an idea of why I might like them in Ruby. 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 . 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. Mikkel