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

reconsider the names of Node::paths() and NodeIterator::path() methods #49

Closed
cyrush opened this issue Sep 16, 2016 · 2 comments
Closed
Labels
Milestone

Comments

@cyrush
Copy link
Member

cyrush commented Sep 16, 2016

We are adding a path() function that returns a string with the full path to the given node

has_path and fetch path variants descend the tree, but, the new path() clashes a bit with a few other uses "path" in method names:

For example, in the Node and Schema classes:

  • the two paths() variants list the names of the node's direct children, not full paths to them.

In the NodeIterator class:

  • path() returns the name of the child, not the full path to the current child

I propose changing the path variants in the Node and Schema classes to

  • child_names() (or similar: names_of_children() , is closer in style to number_of_children())

And path() in NodeIterator to:

  • name()

It's an API breaking change, but I think 0.2.0 is the right time to do this.

@cyrush cyrush added the task label Sep 16, 2016
@cyrush cyrush added this to the 0.2.0 milestone Sep 16, 2016
@cyrush cyrush changed the title review use of paths Node and path NodeIterator review use of paths() Node and path() NodeIterator Sep 16, 2016
@cyrush cyrush changed the title review use of paths() Node and path() NodeIterator reconsider the names of Node::paths() and NodeIterator::path() methods Sep 16, 2016
@cyrush cyrush added design and removed task labels Sep 17, 2016
@cyrush
Copy link
Member Author

cyrush commented Oct 5, 2016

spoke with Brian Ryujin & @xjrc about this, both concur it make sense to make a change.
going to go with

child_names() for the paths() methods in Node & Schema

and name() for the path() method NodeIterator

@cyrush
Copy link
Member Author

cyrush commented Oct 13, 2016

resolved in #71

@cyrush cyrush closed this as completed Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant