I don’t think I’ve ever used tuples. For me having vectors ALSO work for aliasing is much more obviously confusing
Converting both cases to “fake” calls would solve it, though it would be an obviously breaking change:
[:tuple :a :b :c]
or something similar and [:as :foo :bar]
instead of [:a :b :c]
and [:foo :bar]
Breaking aliasing would break a lot of code I suspect -- I couldn't support that change. Breaking tuples is a much smaller breakage I suspect (but I'd like to see feedback to indicate whether I'm wrong).
Given how :as
is used in Clojure, I think the natural syntax would be [:table :as :alias]
even tho' that would be at odds with the prefix-as-operator nature of HoneySQL everywhere else. I think HoneySQL could introduce such aliasing syntax and deprecate the old aliasing syntax but you'd need a steady progression of releases that a) introduced the new syntax then b) produced a warning for the old syntax then c) threw an exception for the old syntax then d) removed the old syntax, in order to give people a safe migration path -- and a way for the library to warn users their code will break, then a specific breakage. Having a change cause potentially silent breakage is an extremely unpleasant UX.