Re: [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-20 00:53:32
|
I guess it's worth thinking about how many languages have an analogue for a Python Tuple. I think I've only come up with Python, Java and C#. What are the other set of languages out there and what are their Tuple analogs: Javascript - None Lisp - None Perl - None Groovy - Java Arrays C/C++ - Arrays, pointers D - Static arrays Php - None Bash - None OCAML - Tuples Smalltalk - None What else? I think Php is an interesting case because it will be tricky to distinguish between a list and a dictionary as it implements both the same way. Bash doesn't really have dynamic arrays, technically, it's all Tuples. Even though Tuples are now implemented, I am not necessary sold on keeping them in there. However, I would like to think about straight forward solutions so that it is fairly easy to get static arrays and tuples to appear in places where they support it. I am ok with the idea that some constructs are only supported by subset of languages. As long as each binding has a way of dealing with those constructs. Again, Php is going to face this problem no matter what. > > I think it makes sense for SIOP to have the notion of a Tuple type. > > Forgive my python ignorance, but what is a tuple and why would I want > one? > > >From a brief glance at a couple python pages, it seems that a tuple is a > > readonly array. Is that really a useful thing? I can't actually think of > any case in my life that I have wanted one. > > I guess the bigger question is whether you plan to support the cool > extra feature of each language, or aim for more of a common subset. |