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
find() with a closure #31
Comments
@UARTman can you please help? |
Sure. Let's check if I understand correctly what you want it to do. It checks for "bar" in children, doesn't find it, then goes through the children, calling the closure on every one, until it finds "bar". Then it uses that edge and goes further. |
@UARTman not exactly. It checks for "bar" in children, doesn't find it. Then, it calls the closure giving it itself (0) and the name of the missing children ("bar"). The closure returns "foo". It finds "foo" in children and continues. I made a mistake in the original description of the ticket. Now fixed. |
@UARTman let's make it even more convenient. Let the closure accept three params: vertex ID, the head of the label, and the tail of the label. Say, the label is |
@UARTman any progress? |
I have an implementation that seems to work in a separate function After we figure out this, I'll have to improve a docstring a bit, and then it'll be ready for merge. |
@UARTman let's merge |
@UARTman any good? |
I'll send a pull request tomorrow. |
@rultor release, tag is |
This is what I would like to be able to do with
Sodg.find()
function:The closure that I provided to
find
function expects two parameters: 1) the ID of the vertex where finding algorithm stopped because edge"foo"
is absent (v=0
), 2) the name of the edge not found (a="bar"
). The closure returns an alternative name of the edge and the search algorithm continues from it.The text was updated successfully, but these errors were encountered: