Temporal References in Phases
Inside a member transform, bare m_x is the pre-transform value and
^m_x is the post-transform value of another member. In a phased
route those meanings are scoped to the current phase, not the whole
route.
| Reference | Meaning in phase Pᵢ |
|---|---|
m_a | Value immediately before Pᵢ’s transforms (already includes earlier phases) |
^m_a | Value immediately after Pᵢ’s transforms |
Using ^member outside a transform body (where, from, route actions,
defaults) is a V43 error.
Cross-phase bare names
Pre-phase already incorporates every earlier write. If P₁ updated m_x,
then inside a P₂ transform bare m_x is the value from P₁:
entity Counter {
routes {
step() => [
first: []
second: []
]
}
m_x: u64 { in step() =>
first: m_x + 1
}
m_y: u64 { in step() =>
second: m_x + 10
}
}
Starting from m_x = 0, m_y = 0:
| Phase | Expression | m_x seen | Result |
|---|---|---|---|
first | m_x + 1 | 0 | m_x becomes 1 |
second | m_x + 10 | 1 (post-first) | m_y becomes 11 |
Same-phase ^
When several members transform in one phase and one needs another’s
new value, use ^:
m_a: u64 { in example() => p1: m_b + 1 }
m_b: u64 { in example() => p1: m_a + 1 }
m_c: u64 { in example() => p1: ^m_a + ^m_b }
^m_a and ^m_b are the results of the first two transforms, so
m_c receives (m_b + 1) + (m_a + 1). Without ^, both names would
still be the pre-phase snapshot.
Visibility summary
| Context | m_x | ^m_x |
|---|---|---|
| Unphased transform | Pre-route | Post-route |
| Phase Pᵢ transform | Pre-Pᵢ (incl. prior phases) | Post-Pᵢ |
| Effect in phase Pᵢ | Post-Pᵢ | Not available in effects |
Effects always see the post-transform state of their own phase; temporal
^ is a transform-only construct.