Skip to content

Null

The null value in Samarium is not represented by any symbol—in fact, it's represented by the lack of it:

x: /;
y:;
z: [-/, , /];
The above code sets x to 1, y to null, and z to [-1, null, 1].

The following code prints 1 if y is equal to null and null is present in z, and 0 otherwise.

y :: && ->? z!;
One could alias null for clarity:
null:;
y :: null && null ->? z!;

Converting null to a number yields the value 0.