Hacker News new | past | comments | ask | show | jobs | submit login

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.



I 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


Right. 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.


To be clear, I didn't say they were equivalent. They're equivalent up to isomorphism, not equal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: