Operators

Read Musi operators by family instead of memorizing one long list.

Musi uses visible operators for binding, math, comparison, logic, type checks, callable types, ranges, access, and pipelines. Learn them by family. Each family has one job.

let port := 8080;
let next := port + 1;
let same := next = 8081;
let capped := next <= 9000;

Operator families

Family Operators Chapter
Bind and compare :=, =, /= Assignment and equality
Math and ordering +, -, *, /, %, <, <=, >, >= Math and comparison
Logic and integer bits and, or, xor, not, shl, shr Logic and bits
Flow and access ` >, ., .[index]`
Types :, :?, :?>, type constraints Type operators
Callable shapes ->, ~>, => Callable arrows
Ranges .., ..<, <.., <..< Ranges

Reading rule

Read the operator before reading the surrounding expression:

let next := port + 1;
let ok := next >= 1024 and next <= 65535;

:= binds next. + computes a new number. >= and <= compare bounds. and requires both comparisons to pass.

If a line uses more than one family and becomes hard to scan, split the line:

let next := port + 1;
let aboveReserved := next >= 1024;
let belowMaximum := next <= 65535;
let ok := aboveReserved and belowMaximum;