Need help?
Ask a question or report a problem on GitHub.
Open an issue
gone: the absence of a value
gone means no value exists. It is not the same as empty text, zero, an empty list, or false.
Gone — Absence of a Value
Otter uses:
Output
gone
to represent the absence of a value.
gone is Otter's equivalent of concepts such as null, nil, or None in other programming languages.
Example:
Otter
user is gone
Check for an absent value:
Otter
if user is gone say "User was not found." .
Check that a value exists:
Otter
if user is not gone say "Welcome" name of user .
gone is a literal value.
It does not require special assignment syntax.
Otter
user is gone
uses the same assignment rules as:
Otter
user is "Jeff"
Gone Is Different From Empty and False
These values are not equivalent:
Otter
user is gone name is "" score is 0 games are empty ready is false
They mean:
Output
gone no value exists "" a string exists but contains no characters 0 a number exists and is zero empty a collection exists but contains no items false a boolean exists and is false
Otter must not automatically treat these values as interchangeable.
Gone Is the Only Absence Keyword
Otter uses only:
Output
gone
for absence.
Do not introduce aliases such as:
Output
null nil None nothing NA
This keeps the language consistent and prevents multiple words from representing the same concept.