渲染zh-Hant

真

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

Represents the true boolean value and can prefix a truthiness check.

Syntax: 真 [<expression>]

Category#

literal

Examples#

radix/corpus/literalia/boolean.fab (canonical · keyword)#

Boolean literals 真 and 假 with 布林 bindings.

main {
    const bool enabled ← true
    const bool disabled ← false
    print enabled
    print disabled
    print enabled and not disabled
}

Expected output:

verum
falsum
verum

radix/corpus/verum/verum.fab (canonical · keyword)#

Represents the true boolean value and can prefix a truthiness check.

test "verum is the true literal" {
    const bool active ← true
    assert active
    assert active ≡ true
}

test "verum stands alone as a truthy condition" {
    assert true
}
# =============================================================================
# 真 — Represents the true boolean value and can prefix a truthiness check.
# =============================================================================
#
# What this teaches:
#   • Boolean literal — `真` as the canonical `true` value for `布林` type
#   • Truthiness prefix — `真` can prefix an expression for explicit truthiness checking
#
# Common mistakes:
#   • confusing 真 (the true literal) with 非 無 (a null check) — 真 is a boolean value, not a presence test
#
# See also: 假, 無
# =============================================================================



# 真 — true literal
#
# GRAMMAR:
#   literal :← '真'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#

main {
    const bool active ← true
    print active
}

Expected output:

verum