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

consistency in key/value combo representations #6

Open
mhelvens opened this issue May 14, 2015 · 1 comment
Open

consistency in key/value combo representations #6

mhelvens opened this issue May 14, 2015 · 1 comment

Comments

@mhelvens
Copy link
Owner

Right now there is inconsistency in how key/value combos are represented throughout the API:

  • When adding vertices and edges, the arguments are given separately, like key, value and from, to, value.
  • When iterating over vertices and edges, they are yielded as [key, value] and [from, to, value] respectively.
  • In the recently supported constructor arguments, vertices and edges are to be represented as [key, value] and [[from, to], value]. This is also used to store vertices and edges in certain exception objects.

The third is going to be standard in the next version. Such consistency will ensure full compatibility between these parts of the API. [[from, to], value] is chosen over [from, to, value] because that way, vertices and edges can always be distinguished, even when the vertex has a string value and the edge has no value at all.

Old notation will still be supported where possible. The main breaking change will be in edge iterators.

@mhelvens
Copy link
Owner Author

The [from, to] representation also goes for methods that need to pass it to callbacks:

  • equals
  • mergeIn
  • clone
  • transitiveReduction

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

No branches or pull requests

1 participant