Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

∧

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Bitwise and, or, xor, not, and shifts on int operands.

Syntax: <expression> ∧ <expression> | <expression> ⊻ <expression> | ¬ <expression> | <expression> ⇐ <expression> | <expression> ⇒ <expression>

Category#

bits

Examples#

radix/corpus/reference/operator-group/bitwise-and/bitwise.fab (canonical · operator-group)#

Bitwise and, or, xor, not, and shifts on int operands.

# =============================================================================
# ∧ — Bitwise and, or, xor, not, and shifts on int operands.
# =============================================================================
#
# What this teaches:
#   • Bitwise operators — `∧` (and), `∨` (or), `⊻` (xor), `¬` (not), `⇐` (shift left), `⇒` (shift right).
#   • Integer bit patterns — Visual demonstration of bitwise operations with binary literals.
#
# Common mistakes:
#   • Confusing ∧ (bitwise and) with et (logical and) — they operate at different levels.
#
# See also: ∨, ⊻, ¬, ⇐, ⇒
# =============================================================================

# operatores/bitwise — ∧ ⊻ ¬ ⇐ ⇒
#
# GRAMMAR:
#   bitwiseExpr :← expr ('∧' | '⊻' | '⇐' | '⇒') expr | '¬' expr
#
# EXPECTED OUTPUT:
#   8, 6, 16, 4
#
# BACKEND:
#   Integer bit patterns; cross-ref binarius/binarius.fab for combined tour.
#   Unary ¬ documented in syntax; Rust emits `~` (whitelist if reintroduced in body).

main {
    let _ vexilla ← 10
    let _ persona ← 12
    let _ coniuncta ← vexilla ∧ persona
    # 8 (0b1000)
    print coniuncta
    let _ diversa ← vexilla ⊻ persona
    # 6 (0b0110)
    print diversa
    let _ sinistra ← 1 ⇐ 4
    # 16
    print sinistra
    let _ dextra ← 16 ⇒ 2
    # 4
    print dextra
}

Expected output:

8
6
16
4