R/MRatCalcpowered by RiX

RiX walkthrough 7 a

Cells and assignment

Aliases, copies, updates, and identity.

See aliasing and copying

Use = to alias a cell, := to create a fresh copy, and ~= to replace a cell's value in place. === asks whether two names still share a cell.

Runnable RiX

The first three values are 9, 9 and 5. The identity checks are true and false: alias shares x's cell, while copy does not. Change the replacement to 12 and check the same pattern.

When copying nested data

For ordinary scalar calculations, := and = are enough. Deep-copy forms (::= and ~~=) matter when nested collections must not share children. Learn them when a concrete nested update requires that distinction.

An in-place update inside a nested function may need an explicit outer reference such as @balance. Scope and imports explains the boundary; Bounded simulation uses one.

Continue with Destructuring when an array or tuple should supply several names.