lỗi
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
Marks a function parameter or binding as carrying an error value.
Syntax: hàm <name>(...) lỗi <ident> → <type>
Category#
function
Related#
Examples#
radix/corpus/errata/errata.fab (canonical · keyword)#
Marks a function parameter or binding as carrying an error value.
# =============================================================================
# lỗi — Marks a function parameter or binding as carrying an error value.
# =============================================================================
#
# What this teaches:
# • Error channel parameter — `lỗi <type>` marks a function as having a typed error channel, enabling structured error handling.
# • Declaration-only — currently a declaration-only modifier; the error channel is whitelisted for syntax validation and future codegen.
#
# Common mistakes:
# • Confusing lỗi with a ⊥ default — `lỗi` declares a typed error parameter on a function; `⊥` provides an inline default on chuyển.
#
# See also: ⇥, bắt, ném
# =============================================================================
# lỗi — typed error channel parameter
#
# GRAMMAR:
# funcModifier :← 'lỗi' type
#
# EXPECTED OUTPUT:
# No bắt_đầu — declaration or test-runner surface only.
#
# BACKEND:
# declaration-only error channel (whitelist: lỗi/errata.fab).
#
fn parse(string raw) errors string → int {
return 0
}