ไม่
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Negates a boolean expression.
Aliases: !
Syntax: ไม่ <expression>
Category#
logic
Related#
Examples#
radix/corpus/non/non.fab (canonical · keyword)#
Negates a boolean expression.
test "non negates falsum" {
const bool flag ← false
const bool negated ← not flag
assert negated
}
test "non negates verum" {
const bool flag ← true
const bool negated ← not flag
assert negated ≡ false
}
test "non applied twice returns the original" {
const bool flag ← false
const bool negated ← not flag
const bool bis ← not negated
assert bis ≡ false
}
# =============================================================================
# ไม่ — Negates a boolean expression.
# =============================================================================
#
# What this teaches:
# • the `ไม่` keyword — unary boolean negation (equivalent to `!`)
#
# Common mistakes:
# • Confusing ไม่ (logical negation) with ≠ (inequality comparison) — ไม่ negates a boolean, ≠ compares two values.
#
# See also: จริง, เท็จ
# =============================================================================
# ไม่ — logical not
#
# GRAMMAR:
# unaryExpr :← 'ไม่' expr
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
main {
const bool flag ← false
const bool negated ← not flag
print negated
}Expected output:
verum