R/MRatCalcpowered by RiX

RiX walkthrough 8

Semantics, types, and units

Conversions, traits, headers, and dimensions.

Orientation

RiX has two complementary kinds of meaning. Semantic types and traits describe runtime protocols; physical quantities carry enforced dimensions and exact unit conversions. Neither requires erasing the underlying exact representation.

Prerequisites: Expressions and Functions. For an exact-mathematics route, begin with Physical units and quantities, then Exact generators and Exact complex numbers. For language protocols, begin with Conversions and Headers and traits. The routes are independent.

Read the type question and unit conversion as separate operations on exact values.

A worked example

Runnable RiX

The final line is the displayed value; the earlier lines set up the experiment. Keep the setup visible so you can tell whether a name, a cell, or a collection is being reused when the expression changes.

Read the result

The first result asks a semantic question. The second performs a physical unit conversion. Continue through headers and traits for protocol metadata, then use the units, exact-generator, and complex-number pages for mathematical meaning.

Change the elapsed seconds and check the converted minutes before changing the semantic test.

Keep going

Continue with Conversions for semantic types or Physical units for quantities.