Renderingla

tabula

Generic key/value map type.

Aliases: map, dictionary

Syntax: tabula<K,V>

Category

collection

Related

Examples

examples/corpus/tabula/methodi-accessus.fab (canonical · existing-home)

Generic key/value map type.

# 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).

incipit {
    varia tabula<textus, numerus> puncta ← vacua
    puncta.pone("aelia", 95)
    puncta.pone("balbus", 87)

    fixum _ aelia ← puncta.accipe("aelia")
    fixum _ absens ← puncta.accipe("carus")
    fixum _ carus ← puncta.accipe("carus") vel 0
    fixum _ habetbalbum ← puncta.habet("balbus")
    fixum _ remotus ← puncta.dele("balbus")
    fixum _ longitudo ← puncta.longitudo()
    fixum _ vacuaest ← puncta.vacua()

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

Expected output:

95 nihil 0 verum verum 1 falsum

examples/corpus/tabula/tabula.fab (canonical · existing-home)

Generic key/value map type.

# 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).

incipit {
    varia tabula<textus, numerus> puncta ← vacua
    puncta["alpha"] ← 1
    puncta["beta"] ← 2
    puncta["gamma"] ← 3

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

Expected output:

3
1
2
3