Renderingla

copia

Generic set collection type.

Aliases: set

Syntax: copia<T>

Category

collection

Related

Examples

examples/corpus/intrinseca/copia-fundamenta.fab (canonical · existing-home)

Generic set collection type.

# copia<T> basic intrinsics
#
# Compiler-owned copia<T> methodi — adde, habet, dele, longitudo, vacua.
#
# GRAMMAR:
#   copia.adde(x) | copia.habet(x) | copia.dele(x)
#   copia.longitudo() | copia.vacua()
#
# copia<T> is a set-like collection; vacua with copia<T> creates an empty set.
#
# EXPECTED OUTPUT:
#   Smoke asserts exit 0 only.
#
# BACKEND: Go e2e whitelist — copia method surface not yet lowered for Go.

incipit {
    varia copia<numerus> numeri ← vacua

    numeri.adde(1)
    numeri.adde(2)
    numeri.adde(3)

    fixum _ habetduo ← numeri.habet(2)
    fixum _ remotus ← numeri.dele(3)
    fixum _ longitudo ← numeri.longitudo()
    fixum _ vacuaest ← numeri.vacua()

    nota habetduo, remotus, longitudo, vacuaest
}