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

Make graph auto nodes default where sensible #39

Open
hollasch opened this issue Feb 18, 2020 · 2 comments
Open

Make graph auto nodes default where sensible #39

hollasch opened this issue Feb 18, 2020 · 2 comments

Comments

@hollasch
Copy link
Owner

Currently, the nodes specification may take the value auto, indicating that the set of nodes should be implicitly derived from the edge specifications.

Consider making this the default behavior, such that a graph's nodes will be the union of all nodes defined both implicitly (via edge references) or explicitly (in the nodes definition). Nodes defined implicitly will get a data value of null (()).

This may mean that some structures like node arrays may need to robustly handle sparse arrays, so we don't blow up allocation.

@hollasch
Copy link
Owner Author

hollasch commented Feb 20, 2020

It just occurred to me that if you didn't make auto nodes the default, you could replace the current (and only) LSON keyword auto with a null element for the nodes. Failing that, an empty array.

@hollasch
Copy link
Owner Author

Didn't realize I'd already thought of this. More convinced than ever to do this. If we do not automatically handle implicitly-defined nodes, then all parsers would need to handle the error of using a node that had not been declared. I don't see much advantage to requiring this.

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