unarius
Translation status: 繁體中文 reader-locale proof. Code fences render through the zh-Hant pipeline; prose is canonical Latin.
Unary negation, logical not, sign comparisons, and optional presence tests.
Syntax: -<expr> | non <expr> | <expr> > 0 | <expr> est nihil
Category#
operators
Related#
Examples#
radix/corpus/unarius/unarius.fab (canonical · operator-group)#
Unary negation, logical not, sign comparisons, and optional presence tests.
# =============================================================================
# unarius — Unary negation, logical not, sign comparisons, and optional presence tests.
# =============================================================================
#
# What this teaches:
# • Unary operators — negation (`-`), logical not (`non`), and sign comparisons
# • Null checks — `est nihil` and `non est nihil` for optional presence testing
#
# Common mistakes:
# • confusing non (logical not, prefix) with - (numeric negation) or ¬ (the Unicode not sign)
#
# See also: non, est, non est
# =============================================================================
# unarius — negation, logical not, sign comparisons, and optional presence
#
# -<expr> non <bivalens> <expr> > 0 <expr> < 0
# <expr> est nihil <expr> non est nihil
#
# GRAMMAR:
# unaryExpr :← ('-' | 'non') expr
#
# EXPECTED OUTPUT:
# unarius.expected — unary operator samples.
main {
# Numeric negation
const _ x ← 5
const _ neg ← -x
# -5
print neg
# Logical negation
const _ flag ← true
const _ non_signum ← not flag
# falsum
print non_signum
# Positive/negative checks
const _ a ← 10
const _ b ← -3
# verum
print a > 0
# falsum
print a < 0
# falsum
print b > 0
# verum
print b < 0
# Null checks
const string ∪ null forsitan ← null
# verum
print forsitan is null
# falsum
print forsitan not is null
const string ∪ null adest ← "salve"
# falsum
print adest is null
# verum
print adest not is null
}Expected output:
-5
falsum
verum
falsum
falsum
verum
verum
falsum
falsum
verum