Skip to content
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

get-in #3

Open
simongray opened this issue Oct 15, 2024 · 2 comments
Open

get-in #3

simongray opened this issue Oct 15, 2024 · 2 comments

Comments

@simongray
Copy link
Member

Basically, it would have the same interface as the get-in of Clojure Core, but the behaviour of the existing get in this library where the coll of ks represents ancestry.

This would rely on a matcher function for ancestry, e.g. maybe called ancestors + a generic matcher for the node itself.

It would also be great to have a similar pair for selecting nodes based on descendants, e.g. a descendants matcher + a generic matcher. However, I'm not sure what to call it since there is no real equivalent in Clojure Core.

@simongray
Copy link
Member Author

Another way around it would be to simply extend the functionality of the existing hiccup matcher to match layers of children as descendants. That way it would be obvious that the outer element is the one selected.

@simongray
Copy link
Member Author

For selecting unknown elements, we will need a universal matcher, maybe change the default of no-argument any to (constantly true) rather than (constantly false)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant