5 ms·
I'm not sure I like a single item tuple being equivalent to just the item. Can you ask for the length of a tuple? The length of a tuple with two 100 element li
by IanCal 4y ago
I'm not sure I like a single item tuple being equivalent to just the item. Can you ask for the length of a tuple? The length of a tuple with two 100 element lists would be 2, and if you looked at the tail the length would be 100.
- dannymi 4y agoI agree. It's better to have single-item tuples still require a comma. (1) - the number 1 1 - the number 1 (1,) - a tuple with one item, which is the number 1 1, - a tuple with one item, which is the number 1
- deleted 4y ago[deleted]
- layer8 4y agoRight. In particular if you identify tuples with lists (which seems reasonable), you run into typing problems, because singleton lists/tuples suddenly have to be unified with the element type.
- louthy 4y agoTo be clear, I didn't say they were equivalent. They're equivalent up to isomorphism, not equal.