selectselect
Arc standard library reference for the select built-in: routing a boolean to a true or false entry
select is a built-in, not a module member: it is available in the global namespace
and needs no import.
bool -> select{}Output
Two named outputs, true and false. The matching output triggers its routing entry.
flag -> select{} -> {
true: true -> press_valve,
false: true -> vent_valve
}
// Omitting a branch is valid:
flag -> select{} -> {
true: true => shutdown_sequence
}An output routing entry can also hold an inline body.
Custom routing
For more than two branches, a custom routing table can be defined using a function with multiple named outputs.