fi

SpecialNodes fi

input ports:
Name Type Description Optional

condition

?0

a value to be interpreted as bool

no

inputT

?1

value selected when condition is true

no

inputF

?1

value selected when condition is false

no

output ports:
Name Type Description Optional

output

?1

output value selected by condition

no

Roughly speaking, fi is the inverse of if. fi reads its condition input without removing the data item. if the value is true, it attempts to read a value from its inputT input, otherwise it attempts to read a value from its inputF input. If there is data present on the selected input, it outputs it to the output port, and removes the item at the head of its condition input. Otherwise, it leaves the condition input as it was and does nothing – it will be fired later and the process repeated until the selected data is successfully read from its inputT or inputF port. inputT and inputF are untriggered input ports, meaning that they are not guaranteed to have data present when the node fires. It is not possible in our intended usage of these nodes to require that data be present on both true and false input ports, since they represent mutually exclusive logical conditions.

It is strongly recommended that fi always be paired with a matching if `node, and that the conditional branches that are controlled by the `if / fi pair be placed in their own circuits, per the guidelines given in Dataflow in Coreograph (Conditionals).