समुच्चय
Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.
Generic set collection type.
Aliases: set
Syntax: copia<T>
Category#
collection
Related#
Examples#
radix/corpus/intrinseca/copia-fundamenta.fab (canonical · keyword)#
Generic set collection type.
# =============================================================================
# copia — Generic set collection type
# =============================================================================
#
# What this teaches:
# • Generic set collection type.
# • Related keywords: lista, tabula, inter
#
# Common mistakes:
# • Using `copia<T>` without an explicit type — `vacua` requires an explicit type annotation like `copia<numerus>` (SEM014).
#
# See also: lista, tabula, inter
# =============================================================================
# copia<T> basic intrinsics
#
# Compiler-owned copia<T> methodi — adde, habet, dele, longitudo, vacua.
#
# GRAMMAR:
# copia.add(x) | copia.has(x) | copia.delete(x)
# copia.length() | copia.is_empty()
#
# 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.
main {
var set<int> numeri ← empty
numeri.add(1)
numeri.add(2)
numeri.add(3)
const _ habetduo ← numeri.has(2)
const _ remotus ← numeri.delete(3)
const _ longitudo ← numeri.length()
const _ vacuaest ← numeri.is_empty()
print habetduo, remotus, longitudo, vacuaest
}