Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

ReferenceMeaning in phase Pᵢ
m_aValue immediately before Pᵢ’s transforms (already includes earlier phases)
^m_aValue 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:

PhaseExpressionm_x seenResult
firstm_x + 10m_x becomes 1
secondm_x + 101 (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

Contextm_x^m_x
Unphased transformPre-routePost-route
Phase Pᵢ transformPre-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.