with_state

Macro with_state 

Source
with_state!() { /* proc-macro */ }
Expand description

A macro for decluttering mutable state computations.

Takes a state expression and code block, and transforms function calls prefixed with :: to include the state as their first argument.

§Example

with_state! { state;
    let x = ::mat_mul(::param(), y) + ::param();
}

Expands to:

let x = mat_mul(state, param(state), y) + param(state);