Creating a vertex is still a pain. It is hard to understand what should go into the config closure and how it relates to what happens outside of the config closure. The vertex closure needs to be streamlined so config traits can be setup and the graph can be setup while the closure is running.
VertexSpec
The config closure will be renamed to runnerCode. It will contain the closure passed to vertex methods.
vertex methods
All methods will create a VertexSpec and pass it to the vertex(VertexSpec) method
A new object that will run VertexSpec.runnerCode. It will perform all statements in the closure on the graph, and vertex. It will control new methods that are available to the closure.
This is an example of what should be able to happen in the closure.
Creating a vertex is still a pain. It is hard to understand what should go into the config closure and how it relates to what happens outside of the config closure. The vertex closure needs to be streamlined so config traits can be setup and the graph can be setup while the closure is running.
VertexSpec
The config closure will be renamed to runnerCode. It will contain the closure passed to vertex methods.
vertex methods
All methods will create a VertexSpec and pass it to the vertex(VertexSpec) method
VertexSpecRunner in vertex(VertexSpec)
A new object that will run VertexSpec.runnerCode. It will perform all statements in the closure on the graph, and vertex. It will control new methods that are available to the closure.
This is an example of what should be able to happen in the closure.
This allows traits to be applied and code to execute against the trait once it is added.