Renderingen-US

tabula

Translation status: English reader-locale proof. Code fences render through the en pipeline; prose is canonical Latin.

Generic key/value map type.

Aliases: map, dictionary

Syntax: tabula<K,V>

Category#

collection

Examples#

radix/corpus/tabula/methodi-accessus.fab (canonical · keyword)#

Generic key/value map type.

# =============================================================================
# tabula — Generic key/value map type.
# =============================================================================
#
# What this teaches:
#   • Map access methods — `accipe`, `ponde`, `habet`, `dele`, `longitudo`, `vacua`
#   • Null-safe access — using `vel` to supply defaults when a key is absent
#
# Common mistakes:
#   • attempting to access a missing key without a default and getting a ∪ nihil value — use vel for fallback
#
# See also: lista, copia, ∷, itera
# =============================================================================




# tabula<K,V> access and mutation intrinsics
#
# puncta.pone(k, v) | puncta.accipe(k) | puncta.habet(k)   -- get/put
# puncta.dele(k) | puncta.longitudo() | puncta.vacua()      -- delete/size
#
# GRAMMAR:
#   mapMethod :← expr '.' ('pone' | 'accipe' | 'habet' | 'dele'
#                         | 'longitudo' | 'vacua') '(' args? ')'
#
# EXPECTED OUTPUT:
#   No pinned stdout — smoke asserts exit 0; tabula/tabula.fab carries scalar contract.
#
# BACKEND: Wasm tier floor FrontendAnalyzed (method surface not yet Runnable;
# whitelist: tabula/methodi-accessus.fab).

main {
    var map<string, int> puncta  vacua
    puncta.pone("aelia", 95)
    puncta.pone("balbus", 87)

    const _ aelia  puncta.accipe("aelia")
    const _ absens  puncta.accipe("carus")
    const _ carus  puncta.accipe("carus") coalesce 0
    const _ habetbalbum  puncta.habet("balbus")
    const _ remotus  puncta.dele("balbus")
    const _ longitudo  puncta.longitudo()
    const _ vacuaest  puncta.vacua()

    print aelia, absens, carus, habetbalbum, remotus, longitudo, vacuaest
}

Expected output:

95 nihil 0 verum verum 1 falsum

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

Generic key/value map type.

# =============================================================================
# tabula — Generic key/value map type.
# =============================================================================
#
# What this teaches:
#   • Map declaration — `tabula<K,V>` with bracket syntax for keyed access
#   • Map literals — empty map via `vacua`, then populating with index assignment
#
# Common mistakes:
#   • using bracket syntax with a key type that doesn't match the tabula declaration, or inserting duplicate keys
#
# See also: lista, copia, ∷, itera
# =============================================================================




# tabula<K,V> declaration, vacua, and keyed lookup
#
# varia tabula<K,V> nomen ← vacua   -- typed empty map (forma innata)
# nomen[key] ← value                -- index assignment
# nomen[key]                        -- keyed accipe
# nomen.longitudo()                 -- entry count
#
# GRAMMAR:
#   mapDecl :← 'varia' 'tabula<' type ',' type '>' ident '←' expr
#   mapAcc  :← expr '[' expr ']'
#
# EXPECTED OUTPUT:
#   longitudo() plus keyed lookups for alpha/beta/gamma (tabula.expected).

main {
    var map<string, int> puncta  vacua
    puncta["alpha"]  1
    puncta["beta"]  2
    puncta["gamma"]  3

    print puncta.longitudo()
    print puncta["alpha"]
    print puncta["beta"]
    print puncta["gamma"]
}

Expected output:

3
1
2
3