-
-
Notifications
You must be signed in to change notification settings - Fork 323
Description
We could do branching by using a special value representing a not-taken branch:
The main problem is that the current execution engine takes all possible paths. This is good and what we want it to do, but it makes branching (where we only want it to take some paths) difficult. So how about we use a special value, let's call it D, to represent a branch that is not taken?
To create a dead branch, a node simply has to output D in any of its outputs. Nodes would then handle D inputs as follows: if any of the required inputs is D, output D, and if an optional input is D, set the input to its default value. This is enough to implement branching (assuming no cycles).
This system would transparently implement branching. The D-input check would happen before actually running nodes, so our current nodes will just work in this system.
That being said, this only how to do branching. I don't have any good ideas as for how we could do the condition expressions.
For more information, see here.