My first guess is that each "each"-test has the side-effect of adding matching signals to a list of output signals. So let's start with a very simple example: In pseudo-code I could maybe write this as:
Code: Select all
if (each_input_matches(=, -1)) output_each()
Code: Select all
output = [] # start with an empty list
foreach signal, value in signals
if value == -1 then output += (signal, value)
return notEmpty(output)
But what if I start to use "and" and "or"? Let's try this: There is a constant combinator (outputing 1=-1, 2=-2) connected as you can see in the list of input signals.
The example consists of two "and"-blocks connected by "or".
There is no belt-signal, so the first and-block is false, but the second one is true.
Nevertheless, the each test in the first and-block does match, because there is a signal with the value -1. So why is the signal "1=-1" not added to the output? Theory: In most programming languages a statement such as "if (A=1 and B=2)" where A<>1 will not check B anymore. So I'd guess that in the example above the decider checks "belts>0", but this is not true and thus the "each_input_matches(=, -1)"-check is not executed. If this theory is correct, then changing the order would change the result. So I try this: This disproves my theory, because the order of the conditions does not change the result. So now I am at a loss. My next theory would be that the decide will reorder the conditions, so that each-checks always come last and they are skipped if any connected and-condition is false. Now I am running out of ideas on how to test this theory and I need your help:
If there are multiple "each"-conditions in a decider combinator, what is going to end up in an output?