prelude.Ref

Part of prelude.

let Ref.get (self: Ref[T]): T

The value currently in the cell.

Implemented by the compiler itself, so it has no Plum source to read.

let Ref.set (self: Ref[T]) (value: T): Unit

Replaces the value in the cell. This is the one way to mutate shared state, and a Ref is what a spawned task can share.

Implemented by the compiler itself, so it has no Plum source to read.