[Siop-development] How to implement the "Tuple" type in Python
Status: Pre-Alpha
Brought to you by:
slobberchops
From: Rapheal K. <ra...@ma...> - 2006-06-18 01:33:32
|
I think it makes sense for SIOP to have the notion of a Tuple type. It's obviously very straight forward for Python and maps relatively ok to Java array objects (vs. List objects). This question is probably only answerable by Kevin, but does anyone have any idea what the best way to go about supporting Ruby Tuples are? Right now, I've implemented a Tuple class, which is akin to an Array class, only it's immutable. Sort of needed to do it like that as creating an Array subclass bought me very little. I needed to either make the array immediately frozen, or better yet, block the mutation methods. However, that was not enough because all the different ways that lists operate often return NEW arrays. However, for Tuples, it should really return new Tuples. Just wondering. The Tuples in the SIOP Ruby library work. However, if there is a better way, I would rather do that. - Rafe |