SplitScript reference / Language / ?

?

syntax

resultExpression?

Propagates a T! error.

Postfix ? unwraps success or transfers the original error to the nearest failure boundary: a retry operand restarts on the next attached update, a state-field assignment rejects that field update, and a T! function returns the error. A state expression may use a value block to perform several local steps; every ? and a fallible final expression still target that one field boundary, so no helper function is required.

Examples

Forward an error from a function

let health = process.read<i32>(healthAddress)?

Reject one state-field update

score: i32 = {
    let address = process.follow(0x1000, [0x20])?
    process.read(address)
};