渲染zh-Hans

且

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

Combines boolean expressions with logical and.

Aliases: and

Syntax: <expression> 且 <expression>

Category#

logic

Examples#

radix/corpus/et/et.fab (canonical · operator-group)#

Combines boolean expressions with logical and.

test "and requires both operands" {
    assert (true and true) ≡ true
    assert (false and true) ≡ false
    assert (true and false) ≡ false
    assert (false and false) ≡ false
}

test "and mirrors the incipit smoke" {
    const bool paratus ← true
    const bool licet ← true
    const bool currit ← paratus and licet
    assert currit ≡ true
}
# =============================================================================
# et — Combines boolean expressions with logical and.
# =============================================================================
#
# What this teaches:
#   • Logical AND — `<布尔> et <布尔>` combines two boolean operands with short-circuit evaluation.
#   • Short-circuit behavior — if the left operand is 假, the right operand is not evaluated.
#
# Common mistakes:
#   • Confusing `et` with `或` — `et` requires both operands to be 布尔 (truthy); `或` requires at least one operand to be truthy.
#
# See also: 或, 非
# =============================================================================


# et — logical AND on bivalent operands (short-circuit)
#
# <布尔> et <布尔>
#
# GRAMMAR:
#   binaryExpr :← expr 'et' expr
#
# EXPECTED OUTPUT:
#   none

main {
    # left operand: 真
    const bool paratus ← true
    # right operand: 真
    const bool licet ← true
    # 真 et 真 → 真
    const bool currit ← paratus and licet
    print currit
}

Expected output:

verum