-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sequentials in addition to vectors for query
#671
Comments
query
Dave, maybe if we were starting fresh with Etaoin as a new project, this might be interesting. But today, I don't really see the point. Do you see a real problem this is solving for users of Etaoin? |
Most of the Clojure collections functions produce seqs. This change would decreases the friction since you wouldn't have to convert to vectors all the time. I think it's low risk and non-breaking. |
But what pain are you solving for Etaoin users? I've not felt it. |
No, I have not felt it myself. |
So why are we solving a problem no one is having? |
Gonna go ahead and close this one. |
Problem/Opportunity
Today, Etaoin supports a vector as the
q
argument toquery
. This casesquery
to perform a sequence of queries, making a not-necessarily fully contiguous path through the DOM. However, Etaoin doesn't support other sequential data types such as seqs or lists. There's really no reason for this as Etaoin doesn't use those types for other query behavior and in fact converts the vector to a seq internally immediately after testing forvector?
. Further, many Clojure collection processing functions (e.g., filter, map, etc.) return seqs, not vectors, and so if generating the query programmatically, today the programmer has to convert to a vector before passing the query toquery
.Proposed Solution
Expand Etaoin's
query
types to allow for anythingsequential?
, giving the same behavior as for vectors today.Additional context
query
throws an exception.query-from-shadow-root-el
function to accept anything that passessequential?
, so if we want to limitquery
to vectors only (today's behavior), I should probably changequery-from-shadow-root-el
to match.Action
Either way, I can supply a PR to update accordingly.
The text was updated successfully, but these errors were encountered: