Renderingen-US

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

Postfix increment statement for a mutable numerus place.

Aliases: postfix increment, increment statement

Syntax: <place> ↑

Category#

mutation

Examples#

radix/corpus/incrementa/incrementa.fab (canonical · operator)#

Postfix increment statement for a mutable numerus place.

# =============================================================================
# ↑ — Postfix increment statement for a mutable numerus place
# =============================================================================
#
# What this teaches:
#   • Postfix increment statement for a mutable numerus place.
#   • Related keywords: ↓, varia, ←, numerus
#
# Common mistakes:
#   • Using `↑` / `↓` inside an expression — postfix increment/decrement are statements only and cannot appear inside larger expressions.
#
# See also: ↓, varia, ←, numerus
# =============================================================================

# incrementa — postfix increment and decrement statements
#
# <place> ↑   -- add 1 (statement only, no value)
# <place> ↓   -- subtract 1
#
# Postfix forms are statements, not expressions. They cannot appear inside
# larger expressions. Operand must be a mutable numerus place.

main {
    var int count  0
    count ↑
    # 1
    print count

    count ↓
    # 0
    print count

    var int exclusivus  0
    for range 03 const _ {
        exclusivus ↑
    }
    # 3
    print exclusivus
}

Expected output:

1
0
3