R/MRatCalcpowered by RiX

RiX walkthrough 7

Cells, shared state and patterns

Compare a fresh value with an alias, then update deliberately.

Share or copy a value

A RiX binding names a cell. := makes a fresh value; = aliases the existing cell. Both names can initially display the same number, but only the alias sees an in-place update.

Runnable RiX

Expect [6, 6, 5]. Use Cells and assignment for identity and deep copying. Destructuring pulls multiple values into names; Properties and metadata covers value annotations.

State in a larger program

An update should be visible at the point where state changes. Bounded simulation uses an explicit loop bound and updates a running balance; read Brace containers first for the loop form. Shared ledger combines cells and structured data.

Continue with Semantics, types and units for values with richer meaning.