Built-in null, optional-value helpers, and
enum tables without new syntax—enums are ordinary hashes of
name → number. See also
Data types and
someProgrammingLanguage/SCOPING.md.
Color key
null, type.isNull, null.coalescetest.isNull (same test as type.isNull)enum.*hash.* (reverse lookup)null
The global null is the single absent value (Python
None). Many stdlib calls return
null on invalid input.
type.isNull(x) → 1 or
0.
test.isNull(x) — same result, for use next to other
test.* helpers.
null.coalesce(a, b) — returns
a if a is not
null, else b.
test.ifTrue(cond) and
test.while(cond) run the body only when
cond == 1. So
null does not take the branch (same as
0).
Logical and / or /
not treat null as
falsy (like 0), so you can write
not / short-circuit style conditions without
null accidentally behaving as “true.”
There is no separate enum type yet: an enum is a hash mapping string names to integers (or other ordinals). Register and bind a name with:
enum.createEnum({ "A": 0, "B": 1 }, Color);
Second argument must be an identifier (variable name), like
hash.createHashTable.
enum.name(enumHash, value) — reverse lookup: label for a numeric value (uses
hash.getKey internally). Returns
null if no matching value.
enum.equals(a, b) — 1 if both ordinals are equal
(numeric equality; both null counts as equal).
Repository:
examples/features_null_enum.spl (expected output documented in-file).
print.boolean(test.isNull(null)); print.number(null.coalesce(null, 42)); enum.createEnum({ "A": 0, "B": 1 }, Color); print.string(enum.name(Color, 1));
Reference table filters: null, enum,
test (test.isNull),
type (type.isNull).