I see what you mean, like could it support full access for both associative and sequential, in a deeply nested way. I’m not sure exactly how.
Maybe with a vector you can kind of do it:
%1[:x 2 :y 3]
This could be from the first argument, get the value of key :x, now if that value is associative, get the value of key 2, but if it is sequential, get the second element, then from that get the value of key :y, and again, depending on if that is sequential or associative, get either the value of key 3 or the 3rd element.
If that syntax can work, it would also support non keyword keys like:
Get the value for key x from the second argument.
And now you mean in that case, %& should be treated as a normal sequential?
%&[:x] ;; This wouldn't be valid
%& ;; This would get the first element of the vararg
I still think that’s weird and not helpful for vararg though. In the case of vararg, you don’t really know the order or number of args passed in. Generally, you’ll probably want either to get them all, or maybe get the first and second or last of them, or like I said, you’d want to use it as a way to do named parameters where the vararg is an alternate of key/values and you’d want to be able to get the value for the key even though it’s a sequential. Supporting all that would feel a bit convoluted to me. But I don’t know, maybe there’s a clever syntax that could do it cleanly.