रेंडरिंगhi

मापो

Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.

Marks a test for metered or measured execution.

Syntax: मापो

Category#

testing

Examples#

radix/corpus/lista/methodi-accessus.fab (canonical · existing-home)#

Marks a test for metered or measured execution.

# =============================================================================
# मापो — Marks a test for metered or measured execution.
# =============================================================================
#
# What this teaches:
#   • सूची access and query intrinsics — `primus()`, `ultimus()`, `accipe()`, `longitudo()`
#   • membership checks — `खाली()` and `continet()`
#
# Common mistakes:
#   • Calling primus() or ultimus() on an empty सूची — these methods require at least one element.
#
# See also: समय, prima, ultima
# =============================================================================

# सूची<T> access and query intrinsics
#
# res.first() | res.last() | res.get(i) | res.length()   -- query
# res.is_empty() | res.contains(elem)                                 -- membership
#
# GRAMMAR:
#   listMethod :← expr '.' ('primus' | 'ultimus' | 'accipe' | 'longitudo'
#                         | 'खाली' | 'continet') '(' args? ')'
#
# EXPECTED OUTPUT:
#   No pinned stdout — smoke asserts exit 0 and typed lowering only.
#
# BACKEND: Go e2e whitelist — सूची intrinsic methods not yet lowered for Go
# (whitelist: सूची/methodi-accessus.fab).

main {
    const list<int> res ← [1, 2, 3, 4, 5] ∷ list<int>
    const int ∪ none primus ← res.first()
    const int ∪ none ultimus ← res.last()
    const int ∪ none tertius ← res.get(2)
    const int longitudo ← res.length()
    const bool vacuaest ← res.is_empty()
    const bool habettres ← res.contains(3)
    print primus, ultimus, tertius
    print longitudo, vacuaest, habettres
}

Expected output:

1 5 3
5 falsum verum