Zachary Turner wrote:
This may cause some disagreements but I'm honestly not sure that I agree with the idea that tuples should behave like sequences. Most other languages that enable functional programming style explicitly disallow this, and for good reason.
Really? "explicitly"? Can you provide an example of a language that explicitly states this and the reasons why?
It leads to bad programming style,
Not in my world... Why?
and makes it all too easy and comfortable to make an arbitrary sized tuple, when usually a tuple of larger than a few elements indicates a programming design problem.
Why?
I also kind of agree with the philosophy that "sequence" should imply "collection of homogeneous types",
Why? which viewing a tuple as a sequence violates. In other
functional languages if you need to manually operate on each element of a tuple other methods are provided like matching. I actually think that it might be possible to achieve some matching like constructs in C++, but I don't think (?) much if any research has been devoted to that.
Erm... every sentence above begs the question: why? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net