I’ve learned some things as a result of our 2 different definitions:
-
Python tuples are an immutable version of Python lists. They can have different lengths.
-
Spec docs https://clojure.org/guides/spec mention tuples:
“Tuple - (s/tuple double? double? double?)
Designed for fixed size with known positional “fields”
Conforms to a vector of the values”
In my older, relational definition (from Chris Date), tuples you might want to sort would always have the same number of fields, because they’d be in the same relation. Missing values would be null. I didn’t understand that you wanted to leave out ‘trailing null fieds’ but still be able to sort. The suggestion above to ‘pad the right-hand fields’ puts us back in the same place.