Units
Culsma uses quantity literals for physical values.
Examples:
100uL
37C
10minQuantity Literals
A quantity is a number with an optional unit suffix.
10
12.5
5mL
95CWhen an operation expects a physical dimension, the unit must be present and compatible with that dimension.
Common Supported Families
| Dimension | Examples |
|---|---|
| Temperature | C, K |
| Volume | uL, ul, mL, ml, L |
| Time | s, sec, min, hr, h |
| Mass | ug, mg, g, kg |
Type and unit checks are handled before runtime execution.
The lexer also recognizes additional unit suffixes used by language contracts, including concentration, agitation, field, percent, power, voltage, and dimensionless-style suffixes:
ng_per_uL
ug_per_mL
rpm
rcf
xg
Hz
mM
uM
nM
nm
um
pct
%
mW
W
V
XNot every recognized suffix is valid in every argument position. For example, duration expects a time unit, and capacity expects a volume unit.
Negative Values
A leading - is expression syntax, not part of the quantity token.
-20CThis still behaves as a quantity-like temperature expression for type and unit checking.
Identifier Deferral
When a quantity is stored in a binding, type checking may defer the final value until the identifier is resolved.
let t = 37C;
with env(thermal = t, duration = 10min) {
hold(sample = reactor);
}This keeps let-bound quantity patterns usable without requiring every value to be retyped at the use site.
Where Unit Errors Appear
Unit problems are typecheck diagnostics, not runtime material errors.
Examples:
- unknown unit
- missing unit where a dimension is required
- volume supplied where time is expected
Runtime remains responsible for state-dependent feasibility, such as insufficient material or capacity overflow.
