MMTMMT Docs
Diagnostics

C001

mutation of a frozen value

C001

A frozen setup value is being mutated after construction. Build it completely before freezing it, or move changing data into a mutable state collection.

Failing example

script "example"
data chart = subscribe(data.ohlcv)
setup xs = [1.0]
on chart.update { xs.push(2.0) }

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
setup initial = [1.0]
state xs = initial
on chart.update { xs.push(2.0) }

On this page