A noob naming question, that I guess doesn't really have an answer, but I thought I'd try anyways. Consider:
(s/def ::triple (s/cat :e string? :a string? :v string?))
Now I may call this vec a triple:
["e", "a", "v"]
But what should I call the (s/conform ::triple) version of it?
{:e "e", :a "a", :v "v"}
I am thinking parsed-triple or conformed-triple, but I wonder if there's a current idiom. If I have some functions that work on one type vs another, I worry about wonky names.named tuple may be confusing as far as element order is not garanteed
Why should order matter after conforming with the spec?
If you're already using tripple as a name, then name it tagged or named tripple as well instead of tuple IMO
tripple is more precise than tuple
The word tuple means “finite ordered list”. https://en.wikipedia.org/wiki/Tuple
It can be vague that named predicate drops the “ordered” characteristic. :-)
From the same article: > Many programming languages offer an alternative to tuples, known as https://en.wikipedia.org/wiki/Record_(computer_science), featuring unordered elements accessed by label.
btw python's named tuples are ordered and support access by index.
record tripple or just record seem to be good names 🙂
It is even matching with clojure.core/record 🙂
named-triple
or just record
https://clojure.org/guides/spec#_collections mentions Conforms to map with named keys based on the cat tags . I would add more naming options like tagged-triple or named-triple . Python has named tuple which looks similar
Oo nice idea! Thanks team
Named tuple