R/MRatCalcpowered by RiX

RiX walkthrough 5 b

Scope and imports

Closures, outer names, and block headers.

Read an outer name

RiX resolves names lexically. Inside a nested callable, @name accesses an outer binding, while block import headers make copying and aliasing explicit.

Runnable RiX

The result is 10. The @ makes the outer read explicit. Change x to 4 and rerun the cell; the function sees the revised surrounding value.

Keep updates clear

Closures retain the scopes they need. When a nested body needs to change an outer cell, make that intention explicit with @name. Cells and assignment explains shared identity and updates; Bounded simulation shows @balance in a loop.

Change the outer binding and rerun the cell to verify what @x reads.

Continue with Multifunctions to combine guarded function variants, or Transforming data for simple callbacks.